1. 程式人生 > >IOS 判斷手機裝置上是否安裝某款應用

IOS 判斷手機裝置上是否安裝某款應用

 判斷裝置是否安裝app,根據Bundle Identifier(下面程式碼中的appCode),如下方法:


NSString *customURL = [NSString stringWithFormat:@"%@://",appCode];

if ([[UIApplicationsharedApplication] //已安裝app

         canOpenURL:[NSURL URLWithString:customURL]])

    {

        [[UIApplicationsharedApplication] openURL:[NSURLURLWithString:customURL]]; //開啟應用

    }

也可在手機瀏覽器中輸入://+Bundle Identifier名稱,來判斷是否安裝應用