taivo / parse-push-plugin

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

Installation not created for Android #79

Closed yingliangzhang closed 7 years ago

yingliangzhang commented 8 years ago

Hi,

This seems like a known issue and it's happening to me as well. I tried to remove the platforms and plugins folder and run ionic state restore but no luck. It was working previously and not sure since when it stopped creating installations for my Android device.

All I did was install the plugin, add config.xml values and call

ParsePushPlugin.subscribe('Default', (msg) => {
      return;
  }, function(error) {
      throw error;
  });

Any idea? Thanks!

yingliangzhang commented 8 years ago

OK I just rebooted the device and it fixed itself! Not sure why but seems like completely uninstall and reinstall the app doesn't help solving this.

rooswelt commented 8 years ago

I have the same problem, but still does not work even after reboot

taivo commented 8 years ago

If by chance you have removed and re-add the Android platform, please also do the same for the plugin.

There is a post-installation step for the plugin that modifies the android manifest and point your application to the appropriate push notification handler. Resetting the Android platform also resets your manifest back to default, so reinstalling the plugin makes things right again.

max-at-brili commented 7 years ago

I am also having this issue. For me it seems related to the post-installation step you mentioned but sometimes it is also fixed by a reboot. In particular my parse server responds to push registration without error, returning a response with an objectId and createdAt property. But when I query the objectID or try to update the installation with channel information I get the response "error: ParseError { code: 101, message: 'Object not found for update.' }"

It seems identical to what Steel Code is experiencing in the following: https://parse.com/questions/remove-cached-parse-installation-from-android-device

temitope commented 7 years ago

I was able to find some relief by adding missing the trailing slash "/" on my parserServerURL variable on the config.xml file. Some more details on my entry in #70

yingliangzhang commented 7 years ago

Holy shit, thank you very much @temitope. This got me again today! I deployed my app to production and found out that no installation is created. Thank god I revisited the issue and found out missing the trailing slash "/" is the cause. I'm gonna add this into my project README.

mihado commented 7 years ago

In my case, I try to leverage Cloudflare & Heroku free SSL to enable https for free.

I think the Universal SSL free plan that Cloudflare offers is not compatiable with Parse Android SDK leading to a com.parse.ParseRequest$ParseRequestException: i/o failure, but it was not easy to arrive at this as the log is swallowed from Parse side.

I've sent PR https://github.com/taivo/parse-push-plugin/pull/85 to enable some logging to help with the debugging.

taivo commented 7 years ago

Thanks @mihado. Your logging PR is very helpful. Eventually, I should just automatically add a slash when there is none.