taivo / parse-push-plugin

Push notification plugin for Cordova/Phonegap/ionic on Parse platform
118 stars 102 forks source link

PPNS - Outdated device #38

Closed pgerlich closed 8 years ago

pgerlich commented 8 years ago

Whenever I attempt to setup plugin I'm running into the outdated device error.

Any thoughts?

ladmerc commented 8 years ago

I have same issue. Unable to send Push notifications from the dashboard. I get same error message

taivo commented 8 years ago

You may find these stackoverflow pages helpful:

  1. http://stackoverflow.com/questions/32476692/outdated-device-parse-push-notification-to-android-devices
  2. http://stackoverflow.com/questions/34499145/android-parse-push-notifications-not-working-outdated-device

@pgerlich , how did you solve this problem for yourself?

paulgerlich-wf commented 8 years ago

@ladmerc The problem you are having may be due to you not signing your APK. That was the issue I was running into.

paulgerlich-wf commented 8 years ago

@taivo Are there any features you've got on the backlog that you need help with? I'd be happy to help contribute.

taivo commented 8 years ago

@paulgerlich-wf, wish you can see how big I'm grinning at that offer. Hopefully I don't make you regret making it. Would really love to get passed a problem with Windows support right now, issue #42

If you have a new usecase that is relevant to this plugin, feel free to propose it as an issue and we can go from there.

ladmerc commented 8 years ago

Thanks @taivo, however none of the above solutions worked.

One thing I noticed though: the first link suggested commenting out some lines in Manifest. When I build again, the lines are uncommented. I think the plugin automatically does that

ladmerc commented 8 years ago

@paulgerlich-wf I'm running on genymotion. I doubt I'm to sign an apk for it.

I noticed the deviceToken and GCMSenderId fields are empty. Is that normal?

Also, Installations are not saved online when I run on a device. The get getInstallationId resolves successfully as well as the subscribe function. But nothing is saved to Parse

taivo commented 8 years ago

"Installation not saved sounds" like a parse setup thing. Did you set the config.xml preference ParseClientKey with the Android/iOS client key? (Not the javascript key).

Please see if the General Troubleshooting section at the bottom of the README would be applicable to your case.

ladmerc commented 8 years ago

Yeah I set everything correctly. Odd thing is that installations get saved when I run app in emulator, but not from device.

I'm considering OneSignal, as I've run out of viable options to get this to work

paulgerlich-wf commented 8 years ago

@ladmerc Are you sure that it's generating a signed APK? I also use Genymotion.

paulgerlich-wf commented 8 years ago

@taivo I'd be happy to take a look tomorrow, although I've not done any Windows development.

taivo commented 8 years ago

@ladmerc it's hard to help debugging without logs. Are you able to give us the logcat? I'm glad to help you get to the bottom of this. Chances are that it's just a setup, config thing.

Also, if possible, please paste or attach AndroidManifest.xml and config.xml here.

You can also try to build the included example app in this plugin's "example" directory. Instructions are in that directory. With the example app working, you can then see what the difference is between it and your app.

ladmerc commented 8 years ago

I apologize if the info I'm providing is too verbose

My config.xml

`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

myApp lorem ipsum. John Doe ` My Manifest ` ` Also, I followed the instructions in the link you provided https://stackoverflow.com/questions/34499145/android-parse-push-notifications-not-working-outdated-device, but whenever I build, my changes get overwritten again.
taivo commented 8 years ago

Those links were just research links, something to try. It's late night where I am so I'm going to review your log tomorrow and see if I can give you any help.

taivo commented 8 years ago

Also, when you say "I noticed the deviceToken and GCMSenderId fields are empty", where did you notice it being empty? in the apk? in some log statement?

taivo commented 8 years ago

Ok, we may be very close to solving this. One thing I can see right away is your manifest <application> tag is missing the attribute android:name="github.taivo.parsepushplugin.ParsePushApplication"

That attribute should be added by this plugin's before_install hook script. The script is supposed to check if your <application> tag has the attribute android:name set. If already set, it will leave things alone. If not set, it will set to the above value.

So 2 things could have happened:

  1. One is the hook script failed. Please verify this by cordova plugin remove parse-push-plugin then cordova plugin add https://github.com/taivo/parse-push-plugin. Observe the console to see if there is any error message. Then check to see if the android:name attribute is correctly set in the manifest.
  2. If the attribute is set correctly but then disappear again after you've built the app, then something else in your build process must have removed the android:name attribute. But let's verify it first by building the app, then check the manifest.
ladmerc commented 8 years ago

Hi, I meant I noticed the deviceToken and GCMSenderId fields are empty in my Installations table in Parse.

I uninstalled and reinstalled the plugin. The Manifest.xml seems correct as you indicated, however now I can't even save installations.

cleever commented 8 years ago

@ladmerc Where are you saving the cordova plugin and platform versions? I can not see them in your config.xml.

If you are not saving anywhere, please run the followings commands to save in your config.xml

$ cordova platform save
$ cordova plugin save

Then run the platforms update:

$ cordova platform update <platform> --save

And then, update your plugins:

$ npm install -g cordova-check-plugins
$ cordova-check-plugins --update=auto
ladmerc commented 8 years ago

@cleever, thanks for the help, and sorry to drag this on. I followed all the steps again and ran on genymotion. Installation not saved.

Removed plugin, platform. Added platform, plugin. Ran again, app crashes. Everytime I remove and readd platform followed by plugin, it crashes

Thanks for the assistance, but after a week on this, maybe I should ditch Parse and consider other options. Cheers

taivo commented 8 years ago

This is super weird. So even after the build process, android:name="github.taivo.parsepushplugin.ParsePushApplication" is still in the application tag of AndroidManifest?

If your app is something that you can share as a whole, I'd be glad to take a look. It's cool if you decide to move on. I understand completely.

taivo commented 8 years ago

@paulgerlich-wf if you want something easy to warm up with, pr #28 has some merge conflicts that needs to be resolved before merging is possible. I'm not sure you can resolve it on the same pr but you can probably pull that code into your fork, resolve then create a new pr.

Badge method would be a pretty useful thing to have. So if you want to, go for it.

paulgerlich-wf commented 8 years ago

Absolutely. Ill check it out on Monday as I'm out of town for the weekend.