Hi guys. i’m trying to develop an app with push notification support…
the my goal is set and create a notification on firebase console that can arrive at all my app users… i’ve seen a lot of things in fuse forum, but i’m really confused and i don’t know how can i do…
someone can help me?
the only things that i do:
MAINVIEW.ux
<App Background="Black">
<JavaScript>
var API_ACCESS_KEY = '2099...639';
var regID = '----HARDCODED REG ID FROM THE APP YOU ARE SENDING TO----';
module.exports.send = function() {
fetch('https://android.googleapis.com/gcm/send', {
method: 'post',
headers: {
'Authorization': 'key=' + API_ACCESS_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
registration_ids: [regID],
data: {
notification: {
alert: {
title: 'Well would ya look at that!',
body: 'Hello from some other app'
}
},
payload: 'anything you like'
}
})
}).then(function(response) {
console.log(JSON.stringify(response));
}, function(error) {
console.log(error);
});
} </JavaScript>
<ClientPanel>...
.unoproj file:
{
“RootNamespace”:"",
“Packages”: [
“Fuse”,
“FuseJS”,
“Uno.Permissions”,
“Fuse.PushNotifications”
],
“Mobile”: {
“Orientations”: “Portrait”
},
“Includes”: [
“",
"Modules/.js:Bundle”,
“Javascript/**.js:Bundle”,
],
“Android”: {
“Package”: “com.apps.radiojay”,
“GooglePlay”: {
“SenderID”: “<2099…6639>”
},
},
“Firebase”: {
“GoogleServices”: {
“Android”: “google-services.json”
},
},
“Projects”: [
“src/Fuse.StreamingPlayer.unoproj”,
]
}