Guest User

Untitled

a guest
Jan 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. /*
  2. This example shows how to use getDistributionStatus method in the TestFairy SDK.
  3. getDistributionStatus queries the server about the app version currently running on device, and checks
  4. to see if "Distribution" is set to "Enabled" in Build Settings page.
  5. The example below will close the app if the distribution was disabled. If there is a newer version of
  6. this app uploaded to TestFairy, and it is set to "Distribution" => "Enabled", then the code will open a url to
  7. the new version, offloading to the operating system to install the app.
  8. */
  9. [TestFairy getDistributionStatus:appToken callback:^(NSDictionary<NSString *,NSString *> *response, NSError *error) {
  10. if (error != nil) {
  11. if ([@"enabled" isEqualToString:[response objectForKey:@"status"]]) {
  12. NSString *urlString = [response objectForKey:@"autoUpdateDownloadUrl"];
  13. NSURL *url = [NSURL URLWithString:urlString];
  14. if (url != nil) {
  15. [[UIApplication sharedApplication] openURL:url];
  16. }
  17. }
  18. }
  19. }];
Add Comment
Please, Sign In to add comment