shareTheVision
shareTheVision

Reputation: 1

Parse Push - Push Notification System for Android App

I am trying to build a robust and reliable Push Notification system for my Android app. Due to various factors, Google's Push Service (GCM) cannot guarantee delivery of notifications, so I decided to switch to Parse Push. This provider implements its own protocol (PPNS) for delivering notifications independent of GCM.

Currently I am facing a challenge with Parse Push - to ensure that its notification service stays ON in the background even after a reboot of the phone. The app is an Apache Cordova based Hybrid app and I added Parse Push to the project using a plug-in + some workarounds.

The current behaviour is that the app receives notification after Opening it once. Thereafter, it receives notifications even when the app is in background or if the app is cleared from memory. But, if the phone is re-booted, Parse Push service doesn't start automatically and hence notifications are not delivered. It requires the app to be opened at least once for the service to be restarted.

So essentially, I need some way of ensuring that Parse Push service is started automatically, even after re-boot of the phone.

Any help regarding this matter is much appreciated. Thanks in advance!!!

P.S: New to Android development

Upvotes: 0

Views: 143

Answers (1)

Huteri
Huteri

Reputation: 158

Add boot completed receiver to set listener after the phone reboot, then start your parse service there.

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<receiver android:name="com.example.MyBroadcastReceiver">  
    <intent-filter>  
        <action android:name="android.intent.action.BOOT_COMPLETED" />  
    </intent-filter>  
</receiver>

Upvotes: 1

Related Questions