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 TiSpeech = require('ti.speech'); | |
TiSpeech.initialize('en_US'); // locale is optional | |
var win = Ti.UI.createWindow({ | |
backgroundColor: '#fff' | |
}); | |
var currentValue = ''; |
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
export default class DeepLinkingManager { | |
constructor () { | |
this.handledLinks = {}; | |
this.activityType = 'io.lambus.app.universalLink'; | |
const activity = Ti.App.iOS.createUserActivity({ | |
activityType: this.activityType | |
}); |
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 FirebaseMessaging from 'firebase.cloudmessaging'; | |
export default class PushManager { | |
listenForPushNotifications() { | |
// Called when the Firebase token is ready | |
FirebaseMessaging.addEventListener('didRefreshRegistrationToken', event => { | |
const fcmToken = event.fcmToken; | |
// Update push token here … |
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
export function showOptions (args) { | |
const title = args.title; | |
const message = args.message; | |
const options = args.options; | |
const destructive = args.destructive !== undefined ? args.destructive : -1; | |
let cancel = -1; | |
return new Promise((resolve, reject) => { | |
if (OS_IOS) { | |
options.push('Cancel'); |
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
export default class Utils { | |
static loadCachedImageFromURL(url, cb) { | |
let filename; | |
try { | |
filename = url.substring(url.lastIndexOf('/') + 1); | |
} catch (err) { | |
cb(null); | |
} |
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
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 TiAnimation from 'ti.animation'; | |
/** | |
* A loader class to show a modal loading indicator | |
* above the current context (even above modal). | |
* | |
* Author: Hans Knöchel | |
* | |
*/ | |
export default class Loader { |
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
func handleData() { | |
let jsonData: [String: Any] | |
let text = String(describing: self.data) | |
// JSON serialisation can fail, use do-catch (like try-catch in | |
// to cope with possible failuresJava/C) | |
do { | |
// JSON data is copied into a key/value dictionary | |
jsonData = try JSONSerialization.jsonObject(with: self.data, options: [.mutableContainers]) as! [String: Any] | |
} catch { | |
return debugPrint("Error occurred: \(error.localizedDescription)") |
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); |