using System;
|
using Foundation;
|
using UIKit;
|
|
namespace Shared
|
{
|
public class Ezviz
|
{
|
public static void OpenEzviz(string url)
|
{
|
// NSLog(@"添加摄像头");
|
// 1.获取应用程序App-B的URL Scheme
|
//var appBUrl = new NSUrl("com.hdl.ezviz-monitor://?com.hdl.i-Life-ezviz");
|
//if (language == "en")
|
{
|
//appBUrl = "";
|
}
|
// 2.判断手机中是否安装了对应程序
|
//if (UIApplication.SharedApplication.CanOpenUrl(appBUrl))
|
{
|
// 3. 打开应用程序App-B
|
UIApplication.SharedApplication.OpenUrl(new NSUrl(url));
|
}
|
//else
|
{
|
// //NSLog(@"没有安装");
|
//appBUrl=[NSURL URLWithString:@"https://itunes.apple.com/cn/app/i-life-ezviz/id1232176145?mt=8"];
|
// UIAlertController* alertVC =[UIAlertController alertControllerWithTitle: @"Go to Apple Store" message: @"download the APP" preferredStyle: UIAlertControllerStyleAlert];
|
//[alertVC addAction:[UIAlertAction actionWithTitle:@"sure" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
// [[UIApplication sharedApplication]
|
//openURL:appBUrl];
|
// }]];
|
// [alertVC addAction:[UIAlertAction actionWithTitle:@"cancel" style:UIAlertActionStyleCancel handler:nil]];
|
// [self presentViewController:alertVC animated:YES completion:nil];
|
//}
|
}
|
}
|
}
|
}
|