This file contains hidden or 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
| # Adapted from http://vojtastavik.com/2018/10/15/building-ios-app-without-xcode/ | |
| SYS_BASE := /usr/local | |
| SYS_LIB := $(SYS_BASE)/lib | |
| SYS_INCLUDE := $(SYS_BASE)/include | |
| ORGANIZATION := # Organization Name | |
| NAME := # App Name | |
| BUNDLE := $(NAME).app |
This file contains hidden or 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 frame = document.createElement("iframe"); | |
| frame.src="https://<the mothership's domain>/inner.html"; | |
| frame.onload = function() { | |
| // If this is a Chrome content script, contentWindow is offlimits. | |
| frame.contentWindow.postMessage("A Message!", "https://<the mothership's domain>"); | |
| } | |
| document.body.appendChild(frame); |
This file contains hidden or 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 Promise = function () { | |
| this.state = 'pending' | |
| this.thenables = [] | |
| } | |
| Promise.prototype.resolve = function (value) { | |
| if (this.state != 'pending') return | |
| this.state = 'fulfilled' |
This file contains hidden or 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
| //callback for user id: | |
| //Either takes the user's advertiserId or creates a unique ID, if | |
| AsyncTask<Void, Void, String> task = new AsyncTask<Void, Void, String>() { | |
| @Override | |
| protected String doInBackground(Void... params) { | |
| try { | |
| AdvertisingIdClient.Info adInfo = AdvertisingIdClient.getAdvertisingIdInfo(YourApplicationClass.this); | |
| if (!adInfo.isLimitAdTrackingEnabled()) {//if user hasn't opt-out | |
| return adInfo.getId(); | |
| }else{ |
This file contains hidden or 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
| /** | |
| * Get ISO 3166-1 alpha-2 country code for this device (or null if not available) | |
| * @param context Context reference to get the TelephonyManager instance from | |
| * @return country code or null | |
| */ | |
| public String getUserCountry(Context context) { | |
| try { | |
| final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); | |
| final String simCountry = tm.getSimCountryIso(); | |
| if (simCountry != null && simCountry.length() == 2) { // SIM country code is available |