1

Hi guyz I am new to Nativescript & I am trying to integrate Firebase with Nativescript but seam to have hit a blocker. I have used nativescript-plugin-firebase to connect to firebase and followed the documentation, but i do not receive any notification on the client (IOS). I have run through all the steps listed in the plugin documentation but dont see any notification, Is there some thing I have to look out for apart from the documentation?

Below are the activities that have been carried out for setting up FCM pushnotification

  1. APN key generated and linked to App created in Firebase account.
  2. GoogleService-Info.plist downloaded and placed in IOS folder.
  3. App capabilities for Remote Notification & Push Notification enabled
  4. Firebase Authentication method is Anonymous
  5. Firebase init triggered and initialized successfully.

after all this Notification from FCM not pushed to client.

  • Did you update the `info.plist` with `UIBackgroundModes` key as given the docs? Do you see the token on `onPushTokenReceivedCallback` callback? How are you sending the notification, from Firebase Console? – Manoj Apr 04 '19 at 05:54
  • Hi Manoj, thanks for your quick reply. I have enabled UIBackgroundModes in the info.plist. No i do not see any token `onPushTokenReceivedCallback` always returns undefined. I are sending the notification from FCM firebase console. – Application Testing Apr 04 '19 at 06:00
  • Which device you are testing it with? Is it a development / distribution build? – Manoj Apr 04 '19 at 06:37
  • I am testing it on IPhone XR, its a development build. – Application Testing Apr 04 '19 at 07:38
  • Hope it that case you have configured the development APNs certificate in your Firebase settings. If you have configured that correctly, at least you should see the permission dialog for Push Notification and the right token in the callback. If you are not seeing either permission dialog / token, it must be something with your configuration only. – Manoj Apr 04 '19 at 12:46
  • Yes I am using an APN key, the same is configured in Firebase settings too. I do get the permission dialog but do not get the token nor the notification. – Application Testing Apr 04 '19 at 14:04
  • Are you using updated provisional profile after enabling push notification capabilities? – Manoj Apr 04 '19 at 14:09
  • Sorry i did not understand your last question. – Application Testing Apr 05 '19 at 06:08

1 Answers1

0

[SOLVED] When the plugin nativescript-plugin-firebase is installed a set of questions are to be answered to generate the firebase config file. After all the questions are answered a config file is generated firebase.nativescript.json which hols the configuration. Delete all unnecessary details (e.g., firestore, realtimedb, admob, etc) from this file and remove POD files & reinitialize POD, then prepare the platform and finally run your application.

The same will throw error (Socket timeout) when run in android, delete the node_modules, hooks & Platforms folders and update the firebase plugin explicitly. Now running a clean build should resolve the error.