This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Cloud = require("ti.cloud"); | |
var deviceToken = null; | |
// Places your already created user id credential | |
if (Ti.Platform.osname === "android") { | |
var CloudPush = require('ti.cloudpush'); | |
// Initialize the module | |
CloudPush.retrieveDeviceToken({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.createWindow({layout:'vertical'}); | |
var label = Ti.UI.createLabel({top:30,width:'90%',height:Ti.UI.SIZE}); | |
win.addEventListener('open',function(){ | |
Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e){ apiInfo(JSON.stringify(e)); }); | |
}); | |
function apiInfo(msg) { | |
Titanium.UI.createAlertDialog({ | |
title: "info", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require the module | |
var CloudPush = require('ti.cloudpush'); | |
var deviceToken = null; | |
// Initialize the module | |
CloudPush.retrieveDeviceToken({ | |
success: deviceTokenSuccess, | |
error: deviceTokenError | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ti.App.Cloud = require("ti.cloud"); | |
Ti.App.CloudPush = require('ti.cloudpush'); | |
Ti.App.CloudPush.enabled = true; | |
Ti.App.CloudPush.showTrayNotification = true; | |
Ti.App.CloudPush.showTrayNotificationsWhenFocused = true; | |
Ti.App.CloudPush.focusAppOnPush = false; | |
Ti.App.CloudPush.singleCallback = true; | |
Ti.App.CloudPush.addEventListener('callback', function(evt) { |