Skip to content

Instantly share code, notes, and snippets.

@baran
Last active August 15, 2016 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baran/9732cc8d684cc03274de9aecd483c18e to your computer and use it in GitHub Desktop.
Save baran/9732cc8d684cc03274de9aecd483c18e to your computer and use it in GitHub Desktop.
// * * * * * * * * * * * * * * * *
//
// <!-- Push Notification -->
//
// * * * * * * * * * * * * * * * *
var Push = require("FuseJS/Push");
var reg_id = Observable("local");
Push.onRegistrationSucceeded = function(regID) {
debug_log("Reg Succeeded: " + regID + "\n");
reg_id.value = regID;
};
Push.onRegistrationFailed = function(reason) {
debug_log("Reg Failed: " + reason + "\n");
displayMessage("PushMessage services failed!")
};
Push.onReceivedMessage = function(payload) {
var msg = JSON.parse(payload);
var metadata = JSON.parse(msg.metadata);
switch (metadata.key) {
case 'key_x':
...
...
break;
case 'key_n':
...
...
break;
}
};
// * * * * * * * * * * * * * * * *
//
// <!-- Push Notification -->
//
// * * * * * * * * * * * * * * * *
{
"RootNamespace":"",
"Copyright": "Copyright (c) 2016 $(Publisher)",
"Description": "Your Description",
"Publisher": "Pivot Bilgi Teknolojileri",
"Version": "1.0.$(VersionCode)",
"VersionCode": 1,
"Packages": [
"Fuse",
"FuseJS",
"Fuse.PushNotifications",
"Uno.Collections",
"Uno.Geometry",
"Experimental.iOS",
"ObjC",
"Android"
],
"Includes": [
"*",
"js/*.js:Bundle"
],
"Mobile": {
"KeepAlive": false,
"ShowStatusbar": true,
"RunsInBackground": true,
"Orientations": "Portrait"
},
"Icon": "assets/icon/gp/play/img-512x512.png",
"Android": {
"Package": "com.yourproject",
"ApplicationLabel": "YourProject",
"VersionCode": "$(VersionCode)",
"VersionName": "$(Version)",
"Description": "Your Description",
"Icons": {
"MDPI": "assets/icon/gp/mdpi/img-48x48.png",
"HDPI": "assets/icon/gp/hdpi/img-72x72.png",
"XHDPI": "assets/icon/gp/xhdpi/img-96x96.png",
"XXHDPI": "assets/icon/gp/xxhdpi/img-144x144.png",
"XXXHDPI": "assets/icon/gp/xxxhdpi/img-192x192.png"
},
"NDK": {
"PlatformVersion": 9
},
"SDK": {
"BuildToolsVersion": "x.x.0",
"CompileVersion": 22,
"MinVersion": 17,
"TargetVersion": 22
},
"Key": {
"Alias": "YourProject",
"AliasPassword": "AliasPassword",
"Store": "release.keystore",
"StorePassword": "StorePassword"
},
"GooglePlay": {
"SenderID": "SENDER_ID"
},
"Geo": {
"ApiKey": "API_KEY"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment