Skip to content

Instantly share code, notes, and snippets.

@milon120203
milon120203 / index.js
Created January 1, 2020 17:27 — forked from MotiurRahman/index.js
Alloy Push notification Test in Android.
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) {
@milon120203
milon120203 / app.js
Created January 1, 2020 17:26 — forked from MotiurRahman/app.js
Push Test
// Require the module
var CloudPush = require('ti.cloudpush');
var deviceToken = null;
// Initialize the module
CloudPush.retrieveDeviceToken({
success: deviceTokenSuccess,
error: deviceTokenError
});
@milon120203
milon120203 / another_geolocation_code.js
Last active December 27, 2019 21:44 — forked from aminulaust/location.js
GPS Location testing
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",
@milon120203
milon120203 / index.js
Created September 10, 2018 17:53 — forked from MotiurRahman/index.js
Push Notification
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({