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({ | |
backgroundColor: '#fff' | |
}); | |
var btn = Ti.UI.createButton({ | |
title: 'Schedule Notification' | |
}); | |
btn.addEventListener('click', function() { | |
schedule('id_1', 'New Notification', 'Hey there!', new Date().getTime() + 3000); |
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
'use strict'; | |
var ButtonTitle = { | |
START: 'Start Microphone Monitoring', | |
STOP: 'Stop Microphone Monitoring' | |
}; | |
Object.freeze(ButtonTitle); | |
var started = false; |
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 pushRequestInitiated = false; | |
var deviceToken = null; | |
Ti.App.addEventListener('resume', function(e) { | |
Ti.API.warn('RESUME'); | |
}); | |
Ti.App.addEventListener('resumed', function(e) { | |
Ti.API.warn('RESUMED'); |
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 AdMob = require('ti.admob'); | |
var win = Ti.UI.createWindow({ | |
backgroundColor: 'black' | |
}); | |
var items = [{ | |
properties: { | |
title: 'requestConsentInfoUpdateForPublisherIdentifiers()', | |
itemId: 'requestConsentInfo' |
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
/* | |
⚠️ Required plist entries: | |
<key>UIBackgroundModes</key> | |
<array> | |
<string>location</string> | |
</array> | |
<!-- For iOS 11+, you need "Always and When in Use" even when requesting "Always" --> |
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 CXCallObserver = require('CallKit/CXCallObserver'); // Require native class from CallKit | |
var CallDelegate = require('callDelegate'); // Require delegate class from app/lib/ (Alloy) or Resources/ (Classic) | |
var myDelegate = new CallDelegate(); // Instantiate Delegate | |
myDelegate.callChanged = function (callObserver, call) { | |
if (call.hasConnected) { | |
Ti.API.info('********** voice call connected **********\n'); | |
} else if(call.hasEnded) { | |
Ti.API.info('********** voice call disconnected **********/n'); | |
} |
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
module.exports = function (json, callback) { | |
// if we have no usage of hyperloop just return | |
if (!json) { return callback(); } | |
// map in our TiApp file | |
json.classes.TiApp = { | |
framework: 'Titanium', | |
name: 'TiApp', | |
methods: { | |
app: { |
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
import { | |
AVMutableComposition, | |
AVURLAsset, | |
AVAsset, | |
AVMutableCompositionTrack, | |
AVAssetExportSession, | |
AVFoundation | |
} from 'AVFoundation'; | |
import { NSArray, NSURL, Foundation } from 'Foundation'; |
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
import { CLGeocoder, CLLocation } from 'CoreLocation'; | |
import { NSLocale } from 'Foundation'; | |
/* | |
* An example class of using the iOS 11.0+ CoreLocation API's to geocode locations. | |
* Feel free to implement more from <http://codeworkshop.net/objc-diff/sdkdiffs/ios/11.0/CoreLocation.html>. | |
* | |
* Usage: | |
* import TiGeocoder from 'geocoder'; | |
* Geocoder.reverseGeocodeLocation({ |
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
/* | |
* SSDP Services in Titanium using Hyperloop | |
* | |
* Based on https://github.com/sboisson/CocoaSSDP | |
* Ensure to add `CocoaSSDP` to your Podfile first! | |
*/ | |
var SSDPService = require('CocoaSSDP/SSDPService'); | |
var SSDPServiceBrowser = require('CocoaSSDP/SSDPServiceBrowser'); |