Software Archive
Read-only legacy content
17061 Discussions

Conneting Intel XDK to Firebase Notifications

Remi_I_
Beginner
352 Views

I have successfully been able to add an App onto the Android Store.

But I am now trying to get notifications on the app.

So far I've only been able to see Firebase which allows you to easily add notifications.

However, I need to add Firebase to my app but on the website

https://firebase.google.com/docs/android/setup

It only allows this through Android Studio. Is there any way around this in Intel XDK?

 

Edit: If its possible please list the example of the code used.

Thanks

0 Kudos
3 Replies
PaulF_IntelCorp
Employee
352 Views

You need to use a Cordova plugin. This one might help > https://www.npmjs.com/package/cordova-plugin-firebase < unfortunately, that plugin uses a gradle script, which means you cannot use our build system with that plugin. You may have to find another notification plugin, there are many out there; some of them will work with our build system, see these FAQs for additional details:

0 Kudos
Pablo_O_
Beginner
352 Views

Hi i have the same problem. i dont know if you find a solution. i was looking for www.onesignal.com

give you intruccion and tutorials to do the notifications using One Signal and conect to firebase.

But im Stuck in the Script i have tu put on mi APP (APK).

Couse the APK does not conecct with Onesignal.

Should by simple, but cant make it work.

// Add to index.js or the first page that loads with your app.
// For Intel XDK and please add this to your app.js.

document.addEventListener('deviceready', function () {
  // Enable to debug issues.
  // window.plugins.OneSignal.setLogLevel({logLevel: 4, visualLevel: 4});
  
  var notificationOpenedCallback = function(jsonData) {
    //console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));
	alert("La Notificacion fue Recivida");
  };

  window.plugins.OneSignal.init("ONESIGNAL_ID_APP",)
                                    {googleProjectNumber:"NUMBER_ID_FIREBASE"},
	notificationOpenedCallback);
  //window.plugins.OneSignal
   // .startInit("67c4fa25-20f0-4b00-b6ad-2192cc825113")
   // .handleNotificationOpened(notificationOpenedCallback)
   // .endInit();
	
	window.plugins.OneSignal.setSubscription(true);
	window.plugins.OneSignal.enableNotificationWhenActive(true);
	
  // Sync hashed email if you have a login system or collect it.
  //   Will be used to reach the user at the most optimal time of day.
  // window.plugins.OneSignal.syncHashedEmail(userEmail);
}, false);


 

0 Kudos
Pablo_O_
Beginner
352 Views
0 Kudos
Reply