Hi All,
I’m trying to use this Parse Plugin in app.js but due to some issue the plugin is not working when i integrate it with my project. I followed the steps below
Create Blank Ionic demo project.
Run this command cordova plugin add https://github.com/benjie/phonegap-parse-plugin
ionic platform add android
App.js looks like this
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
This works fine and as expected, which means the plugin is installed properly and works fine.
Issue
But, then I replace my project’s www folder to the demo projects www and then do the same task. In this case I am getting alert parsePlugin undefined.
Main project App.js Looks like this
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
Thanks for reply @darrenahunter
ok so you’re saying we don’t need the plugin at all?
In that case can we directly write Parse.initialize("XXX","XXX") in app.js? please provide some link or code snippet.
Parse.initialize(Xxx,xxx) doesn’t add your installation to the Parse database - it runs locally on the client and really just sets the appid and jsid for use in other parse calls. you need to call parse._getInstallationId and then run the rest api call to add the installation to the devices database
Now the device gets registered to the Parse and I can also see it in dashboard.
But, now if I try to push notification using CURL of REST API it is not received in emulator. Parse says
If you upload Android installations with GCM credentials, then you must also set the GCM API Key associated with this GCM sender ID in your application’s push settings
So, I’ll require GCM Credentials, right?
b. Sending a REST API we’ll need to generate device Type unique for every device.
c. the Plugin that I mentioned in the question handles all this.
I am about to start integrating Android and was wondering if @jjpatel361 figured out how to send Push Notification to Android devices?
I was lucky enough to get iOS pushes work with Parse Plugin plugin.
Hi @kikados
I am done with integrating the Parse Plugin with Android. I used this plugin https://github.com/avivais/phonegap-parse-plugin . It works fine, but the problem is the plugin is outdated (based on Parse 1.3 and latest version is 1.8 and has many methods of 1.3 as deprecated) and unfortunately the author has lost interest in updating the repo.
But, for the basics, the plugin gets our work done. Private Message me if you have any more issues or want some info.
i have added parse plugin using the steps mentioned in the https://github.com/avivais/phonegap-parse-plugin
but still i get "parsePlugin is not defined"
on initializing in app.js like “parsePlugin.initialize(appId, clientKey, function()”