Can you please post a sample on how to receive push notifications when I restart the android device?
I have built and app using ng template and im trying to register firebase init on device boot_complete:
app.android.registerBroadcastReceiver(android.content.Intent.ACTION_BOOT_COMPLETED,
function onReceiveCallback(context: android.content.Context, intent: android.content.Intent) {
let firebase = require("nativescript-plugin-firebase");
firebase.init({
....
....
});
But this doesnt work. I get push notifications when i open once the app, but when i restart the device it doesnt get any push notifications (at least without opening the app once again). The firebase code and the broadcast receiver is inside my home.ts constructor() which is accessed every time i open the app.
Can you please post a sample on how to receive push notifications when I restart the android device? I have built and app using ng template and im trying to register firebase init on device boot_complete:
But this doesnt work. I get push notifications when i open once the app, but when i restart the device it doesnt get any push notifications (at least without opening the app once again). The firebase code and the broadcast receiver is inside my home.ts constructor() which is accessed every time i open the app.