Phonegap push notification with parse.com - javascript

Im looking for a way to implement push notification on a phonegap application using javascript and parse.com. I found this turorial for iOS
http://www.ladeezfirstmedia.com/2013/08/01/tutorial-part-5-push-it-real-good-with-push-notifications-using-corona-sdk-and-parse-com/
, which seems pretty straight forward, and this tutorial for android http://www.raymondcamden.com/index.cfm/2012/10/10/PhoneGap-Parsecom-and-Push-Notifications.
However, Im using cordova 3.3. and rather stay away from editing the AndroidManifest, which I need to do in the last tutorial. Can any one point me in the right direction, maybe to a tutorial where I can use cordova plugin and easily combine it with parse.com by using javascript for both iO and Android? Btw Im building my project locally in the terminal.
What I want is to notify the user, when its their turn in a game.

Have a look at this answer I've just posted, I've just got the Android Parse PNs working:
How do I get Parse.com Push Notifications working in a Cordova/Phonegap Android app?
It does require you to modify the AndroidManifest and some of the Java files as well, but not a lot. I can't find a plugin that works without doing some of the work myself.
You can use the plugin for iOS as well, you don't need to edit any of the iOS source code but will need to generate a certificate for iOS push notifications, as documented on Parse.
https://parse.com/tutorials/ios-push-notifications

Related

all cordova plugins give undefined error

I am working on a cordova android app. I am trying to implement push notifications. I tried so many ways using ngcordova, using normal plugin and some other methods all tries give me pushNotification undefined error. But the plugins are being installed without any error.
Then I followed this tutorial and did exactly the same, but it gives
device is not defined
error in the console. I used ripple emulator to test this. I installed it in the phone too, But the same error. I am using angularjs inside. and using cordova version 5.2.0. can anyone point me in a direction, I am really trying hard for the past 4 days but no luck. Please help me.
update
I have correct setup of angular and cordova I believe, because I already built an version of my app with the same setup and pc, and released it in play store. This problems arise only if I add some plugins like push, device, etc. In app browser and splash screen plugins are working fine though.
Make sure to include cordova.js, but it need to be load after angular.js.
If you want, here's a working seed:
https://github.com/marioaleogolsat/cordova-angular-angularMaterial-seed
Just remember that some plugins can't be used in a emulation, so use cordova run --device to make sure that anything is working properly.
Hi It seems you have not done set up of Angular JS and Cordova properly.
Before doing push notifications. You must be ready with Angular JS and Cordova setup.
See below link:
Angular JS and Cordova setup
Follow above link and if it's done try to set up again push notifications.
Hope it helps you.
If Cordova is undefined you probably don't have it referenced in your index page. make sure you have this line.
<!-- Cordova reference, this is added to your app when it's built. -->
<script src="cordova.js"></script>

Intel XDK, geolocation based

I'm trying to implement an augmented reality application in which we can visualize elements by using the camera device in background.
I have to implement this feature only by using javascript (and cordova). In cordova, I can only use the camera application itself, not just a preview and the HTML methods are not sufficient... so I've searched for other things.
I've found first wikitude. The problem was that it's not free, and too complicated.
I'm disappointed because it was perfect in the method of integration (simple plugin of cordova to add etc... and use it as a simple plugin like compass, geolocation etc...)
After that, I've found an other thing: intel xdk. But the problem is that I have to install the intel xdk on the computer directly, use an other software to develop the code. If we could just use a thing like:
<script src="something_to_use_directly_intel_xdk_without.js"></script>
And after that the common method:
intel.xdk.display.startAR();
But the problem, as said before is that I can't use directly this framework in the javascript files, in the manner of wikitude or a simple import.
So here I am, trying to use a simple plugin or something like this just to display the camera preview in background. And the only things to do were to add elements on this background easily computed by using the accelerometer, compass and geolocation plugins of cordova.
So, if you have any ideas (simple ideas just to display the camera in background!!), it would be very helpful. So if you have any suggestions please tell me!
if you want to get started with Wikitude, there is a sample application inside the SDK package with source code for Android and iOS you can use as a starting point and you can request a trial licence to set up your project.
Moreover, if you already use cordova, Wikitude also has a PhoneGap plugin (on GitHub: https://github.com/Wikitude/wikitude-phonegap).

Check if a URL scheme is registered on iOS or Android in Cordova

I want to check if a particular app is installed and if it is installed, invoke it.
AFAIK, the way to do it is to check if the custom url scheme of the app is registered and use that url to launch the app.
Is there a way for me to do this in my Cordova app?
To be very specific I want to check if the Google Maps application is installed on iOS and if it is, launch it with its custom url else show the default Apple maps.
This url : https://developers.google.com/maps/documentation/ios/urlscheme : shows how to do it in Objective-C, but how do I do it in Javascript in my Cordova app?
I could not find any plugin to achieve the same. Other questions on SO deal with either doing this from a native app or JS on a regular website (in the browser). The most common work-around is to try launching and use a timeout to see if the app launch failed and still my app is running. This is pretty unclean. Access to the iOS API canOpenURL through JS would be best.
Hints?
Cordova does not ship with this feature. There is a plugin which implements it for iOS, though.
https://github.com/philbot5000/CanOpen
I did not find anything for Android yet, but I do not think this would be hard to do in native Android Code. Even if you are not proficient with Objective-C or Java and never intend to write fully native apps, you should learn some basics if you want to build apps with Cordova.
Small and simple plugins are really easy to do. Read the docs and have a look at the code of some simple plugins to see how it is done. For example the source code of the one above or of the one below is really simple and straightforward to understand:
https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin

How to manually install Phonegap libraries without Xcode?

Do I need to install Phonegap libraries or is it enough to copy them to a place where the app scripts stay?
I am developing an app in javascript,html,jquery,css php ect using Dreamweaver on Windows. I want to use cordova-2.0.0 which is the last version of Phonegap for uploading pictures from an album or from capturing them. I have grabbed the full example from http://docs.phonegap.com/en/2.0.0/cordova_camera_camera.md.html#Camera This code requires src="cordova-2.0.0.js" and the problem is I do not know if I should install Phonegap or copy its libraries to a place that the sample script can see them.
I haven't done it without xcode so maybe not the best answer however you could try IBM Worklight which is an eclipse based IDE that has PhoneGap or alternatively would be to look at something like Sencha Touch which has native development capabilities in HTML5 as well.
You copy the PhoneGap libraries to a suitable location and then you import the files into your application project. PhoneGap homepage provide details on how to do this.
Since you don't want to use Xcode, I'm assuming it is because you are using Windows. Have you seen this guide about creating Phonegap iOS apps?
Detailed Guide for setting up building iOS apps without a Mac
EDIT: If you are trying to create a web app that is accessed from Safari, and you are trying to upload photos, then you should probably read this question

Trouble with iOS and PhoneGap

Just started trying to adapt my html, css, javascript files to iOS using PhoneGap (I've also tried NimbleKit but the result is the same). I have a web app that I originally wrote for the Blackberry Playbook. The app works fine on the Playbook and in Chrome and Safari. However, when I try and run it through XCode with PhoneGap, the app displays on the simulator but does not seem to properly run the database coding (at least I think that is the problem). I do not get any build errors.
From the documentation, NimbleKit seems to just support its own internal SQLite, but PhoneGap seems to support WebDB, which is what my database is written in.
Finally, the simulator doesn't seem to run some global variables I have (I know, I know, don't use global variables) although that could be because they appear just after my DB initialization at the beginning of my javascript file.
Any thoughts or points in the right direction would be very helpful. Even if it is to some documentation which can help me debug the app in the iOS sim.
Thanks in advance.
Cold your problem be related to this?
http://phonegap.com/2012/04/18/ios-5-1-and-the-embedded-uiwebview-with-cordova/
I was facing a similar problem with PhoneGap and iOS Simulator last week,
all the code i wrote seem to have no problem,
anyway i tried this remote web inspector, and tried to create a database remotely using Safari Javascript Console,
bottom line I found that I was not able to create web database using iPhone Simulator,
looks like you need to deploy your app onto your device to make use of it.
I might be wrong, but that was what I found.

Categories