如果用戶設備未註冊 Airwatch Agent,如何限制 iOS 應用程序? (How to restrict iOS App if user device is not enroll with Airwatch Agent?)


問題描述

如果用戶設備未註冊 Airwatch Agent,如何限制 iOS 應用程序? (How to restrict iOS App if user device is not enroll with Airwatch Agent?)

在android中,我們可以很容易地檢查設備是否註冊如下:

final boolean isEnrolled = awSDKManager.isEnrolled();
if (isEnrolled) {
      final String settings = awSDKManager.getCustomSettings();
}

iOS平台也有類似的功能,通過它我們可以檢查用戶設備是否安裝或註冊了AIRWatch代理應用程序.

請指導我。


參考解法

方法 1:

Firstly initialize AWController for the AIRWatch integration in

‑ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  AWController *controller = [AWController clientInstance];

  // 2) Defining the callback scheme so the app can get called back ‑‑
  // this should match the URL scheme you defined in "Callback Scheme Registration".
  controller.callbackScheme = @"awsdkcallback";
  controller.delegate = self;
  [controller start];

    return YES;
}

then use the following delegate method to check your device is enrolled or not

‑ (void) initialCheckDoneWithError: (NSError *) error {
  if (error) {
    NSLog(@"Error in initialization: %@", [error localizedDescription]);
        NSLog(@"Not enrolled on AirWatch agent");
  } else {
    NSLog(@"Initialization completed without error");
  }

}

Update: for Latest AirWatch SDK 18, Use the following method for the same:

 [controller queryDeviceEnrollmentStatus:^(BOOL isSucess, NSError *error) {

    NSLog(@"Error is : %@",error.localizedDescription);
  }];

(by Aashish1augAashish1aug)

參考文件

  1. How to restrict iOS App if user device is not enroll with Airwatch Agent? (CC BY‑SA 2.5/3.0/4.0)

#airwatch #mdm #iOS






相關問題

ipa 文件包含非法字符? (ipa file contains illegal characters?)

通過 AirWatch 卸載 Android APK (Uninstall Android APK via AirWatch)

如何使用設備的自定義屬性來獲取產品的版本號 (How can I use Custom Attributes for devices in order to get Version number of Products)

如果用戶設備未註冊 Airwatch Agent,如何限制 iOS 應用程序? (How to restrict iOS App if user device is not enroll with Airwatch Agent?)

AirWatch MDM 與 Xamarin ipa (AirWatch MDM with Xamarin ipa)







留言討論