Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This example shows how to use getDistributionStatus method in the TestFairy SDK.
- getDistributionStatus queries the server about the app version currently running on device, and checks
- to see if "Distribution" is set to "Enabled" in Build Settings page.
- The example below will close the app if the distribution was disabled. If there is a newer version of
- this app uploaded to TestFairy, and it is set to "Distribution" => "Enabled", then the code will open a url to
- the new version, offloading to the operating system to install the app.
- */
- [TestFairy getDistributionStatus:appToken callback:^(NSDictionary<NSString *,NSString *> *response, NSError *error) {
- if (error != nil) {
- if ([@"enabled" isEqualToString:[response objectForKey:@"status"]]) {
- NSString *urlString = [response objectForKey:@"autoUpdateDownloadUrl"];
- NSURL *url = [NSURL URLWithString:urlString];
- if (url != nil) {
- [[UIApplication sharedApplication] openURL:url];
- }
- }
- }
- }];
Add Comment
Please, Sign In to add comment