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
// A cloud Code function that is called from iOS, Android and web | |
// each time an athlete logs into the app | |
// Updates the athlete and creates an entry in the "TB_Login" class | |
// NOTE: isDefined is a utility function defined elsewhere | |
Parse.Cloud.define("athleteDidLogin", function(request, response) { | |
// req'd params | |
var athId = request.params.athId; |
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
#pragma mark URL SCHEME TESTING | |
- (IBAction)launchButtonTouchUpInside:(UIButton *)sender { | |
// Sample code to open the SugarWOD iOS app from another app | |
// will attempt to open the app, | |
// if app is not installed, | |
// will re-direct to the SugarWOD page in the app store or in Safari | |
// SugarWOD URL Scheme | |
NSURL *url = [NSURL URLWithString:@"sugarwod://"]; |
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
// Sample code to open the SugarWOD iOS app from another app | |
// will attempt to open the app, | |
// if app is not installed, | |
// will re-direct to the SugarWOD page in the app store or in Safari | |
// SugarWOD URL Scheme | |
NSURL *url = [NSURL URLWithString:@"sugarwod://"]; | |
if ([[UIApplication sharedApplication] canOpenURL:url]) { | |
// open sugarwod 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
// Adapted from: | |
// https://stackoverflow.com/questions/2780102/open-another-application-from-your-own-intent/7596063#7596063 | |
/** Open SugarWOD. | |
* @param context current Context, like Activity, App, or Service | |
* @return true if likely successful, false if unsuccessful | |
*/ | |
public static boolean openSugarWOD(Context context) { | |
String packageName = "com.flatironssoftware.sugarwod"; | |
PackageManager manager = context.getPackageManager(); |