Read the blog at http://fokkezb.nl/2013/08/26/url-schemes-for-ios-and-android-1/
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
<?php | |
// Put your device token here (without spaces): | |
$deviceToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; | |
// Put your private key's passphrase here: | |
$passphrase = 'xxxxxxx'; | |
// Put your alert message here: | |
$message = 'A push notification has been sent!'; |
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 = Titanium.UI.createWindow({ | |
backgroundColor : 'red', | |
}); | |
// get refernce to the current window | |
var queslabel = Titanium.UI.createLabel({ | |
text : 'Question', | |
height : 50, | |
color : '#000000', | |
font : { |
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
This gist is only for Android. | |
If you would like launch native apps | |
on iPhone, iPad, you can find information about it in Appcelerator Docs: | |
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.canOpenURL-method.html | |
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.openURL-method.html | |
More info about iOS URL Schemes: http://handleopenurl.com/ |
This gist assumes:
- you have a local git repo
- with an online remote repository (github / bitbucket etc)
- and a cloud server (Rackspace cloud / Amazon EC2 etc)
- your (PHP) scripts are served from /var/www/html/
- your webpages are executed by apache
- apache's home directory is /var/www/
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
// gcm.js | |
/** | |
* Librería gcm - CommonJS - Alloy | |
* @author Andrés Castaño Cuervo | |
* @version 1.1.1 | |
* Copyright Evomedia | |
* www.evoluciondigital.com.co | |
*/ | |
// Inclusión del módulo. |
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
<?php | |
// Provide the Host Information. | |
//$tHost = 'gateway.sandbox.push.apple.com'; | |
$tHost = 'gateway.push.apple.com'; | |
$tPort = 2195; |
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
<?php | |
// Server file | |
class PushNotifications { | |
// (Android)API access key from Google API's Console. | |
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI'; | |
// (iOS) Private key's passphrase. | |
private static $passphrase = 'joashp'; | |
// (Windows Phone 8) The name of our push channel. | |
private static $channelName = "joashp"; |
Quick Example of registering a scheme in TiApp.xml, implementing the code in app.js / alloy.js
OlderNewer