In my phonegap application for android, in app.js, I am trying to execute
cordova.plugins.backgroundMode.enable();
in app.js but I am getting cordova.plugins as undefined. Now in my index.html I have included cordova.js file. But which file I need to include to make plugins available to cordova global variable? I am not able to understand how to make cordova.plugins available. window.plugins is available but backgroundMode is undefined then. Please help me out here. It seems I am missing out some conceptual part.
Ok...I dont know how but I solved my issue by creating a new project again. There might be some mistake from my side while creating the previous app.
Related
I'm new to react-native, I'm trying to use react-native-appsee for my app analytics, according to appsee website documentations it should be easy. I did everything exactly like the documentations but when I tried to run the app it gave me the undefined native module error
which says undefined is not an object (evaluating 'AppseeBridge.start').
I don't think it's appsee problem because I tried to make my own module using appsee java files and it didn't work either.
anyone could help me with fix this?
here is my dependencies:
"react": "^16.0.0-alpha.12"
"react-native": "0.51.0"
"react-native-appsee": "^2.3.64"
I found the answer myself, apparently all I had to do was to create an appsee.js file and export the module then I could use it in my code!
My application was working fine.
Yesterday I installed SQLite plugin in my app, then suddenly inappbrowser plugin stops working.
When I run the project it says, open of undefined error
Check your cordova_plugin.js file. Whether inAppBrowser is defined there or not. If not define it
Also add refrence in config.xml file in res folder
Im building a simple game with Xamarin/Cocossharp in a Shared Project.
I added some physics with Box2D and everything works well on WP8.1.
I import Box2D and i access to the methods and class provided without problem on Windows Phone, but when i try to compile it for Android it says that the type or namespace "Box2D" could not be found. Intellisense doesn't shows any error...
error output
I'm new to game dev and also to VS2015 so it may be something simple but i dont understand what I'm missing here.
Thanks in advance
After struggling around with this i managed to fix this:
As pointed out from Sven-Michael in his answer the solution was to install:
CocosSharp.PCL.Shared
from NuGet. In my case was only necessary to add the reference to the Box2D.DLL file contained into the package.
The reason why it was not working for me it's probably that because of trying to solve this problem I've messed up whit my solution and caused other problems. So I created a new Project from skratch and I've imported my source code again.
Ensure that you have installed CocosSharp.PCL.Shared to your Android project.
E.g. via PM-Comsole:
Install-Package CocosSharp.PCL.Shared
But it can be installed via NuGet, too. This will add box2d and some other dependencies automatically.
I'm working on a phonegap project. I initialized OneSignal in my app.js file according to the documentation. But when I start my app, it gives Uncaught ReferenceError: OneSignal is not defined. I'm not so much familiar with phoegap and onesignal. If you need further explanation, please comment.
Thank you
For PhoneGap the OneSignal code should be added to your first page. Most of the time this index.js. Adding it to the app.js file is for Intel XDK and Ionic. 2. Add required code.
It is possible the OneSignal plugin did not get fully added, check the logcat (Android) or the Xcode device log (iOS) for errors before the one you noted above.
Lastly you can try a Clean Build.
I found my uBlockOrigin chrome extension was blocking it. Not sure what to do to fix it but yeah. Give that a check.
As per 'Platform-centered workflow' from https://cordova.apache.org/docs/en/latest/guide/overview/index.html created a project with help of https://github.com/apache/cordova-android repository on local (cordova version: 5.1.0-dev)
Used plugman to add file plug-in into project but getting error cordova.file object is undefined while accessing it in console or alert. cordova object is coming successfully in any dialog box.
Tried with following to solve it but no of use:
github.com/apache/cordova-plugin-file
cordova plugin add cordova-plugin-file
cordova plugin add cordova-plugin-file#4.0.0
All the entries into config.xml file and AndroidManifest.xml are correct after adding any way to add plug-in.
Please suggest anyone to help this.
are you sure cordova.file pluging has added to project ?
if yes, make sure you called cordova.file after device is ready.
document.addEventListener("deviceready", onDeviceReady, false);
and also cordova.file is not working on emulator. (in my experience)