一:http請求(info.plist)
NSAppTransportSecurityNSAllowsArbitraryLoads
NSAllowsArbitraryLoads 設置YES
二:資源文件打包bundle(setting)
1,setting Base SDK
2,iOS deployment target
3,COMBINE_HIDPI_IMAGES? -> NO
三:權限設置(info.plist)
在info.plist 文件中 添加 權限設置
Privacy - Photo Library Usage Description
App需要您的同意,才能訪問媒體資料庫
NSBluetoothPeripheralUsageDescription
App需要您的同意,才能訪問藍牙
NSCalendarsUsageDescription
App需要您的同意,才能訪問日歷
NSCameraUsageDescription
App需要您的同意,才能訪問相機
NSHealthShareUsageDescription
App需要您的同意,才能訪問健康分享
NSHealthUpdateUsageDescription
App需要您的同意,才能訪問健康更新
NSLocationAlwaysUsageDescription
App需要您的同意,才能始終訪問位置
NSLocationUsageDescription
App需要您的同意,才能訪問位置
NSLocationWhenInUseUsageDescription
App需要您的同意,才能在使用期間訪問位置
NSMicrophoneUsageDescription
App需要您的同意,才能訪問麥克風
NSMotionUsageDescription
App需要您的同意,才能訪問運動與健身
NSPhotoLibraryUsageDescription
App需要您的同意,才能訪問相冊
NSRemindersUsageDescription
App需要您的同意,才能訪問提醒事項
四:使用自己創建的framework
如果framework中有資源bundle,一定要把bundle單獨再拖到項目中一次。
將自己打包的framework添加到embeded binaries中。
五:通訊白名單(info.plist)
LSApplicationQueriesSchemes中添加
六:跳轉App(info.plist)
設置目標app的URL types
在跳轉app中的通訊白名單中加入自己app的Scheme
下一段代碼進行跳轉
NSString*url =@"TestDemo://com.TestDemo.www";
if([[UIApplicationsharedApplication]
canOpenURL:[NSURLURLWithString:url]])
{
[[UIApplicationsharedApplication]openURL:[NSURLURLWithString:url]];
}
else
{
NSLog(@"can not open URL scheme TestDemo");
}
目標app中進行接收
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url
{
// 接受傳過來的參數
NSString*text = [[urlhost]stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
UIAlertView*alertView = [[UIAlertViewalloc]initWithTitle:@"已跳轉到app"
message:text
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertViewshow];
returnYES;
}
以上。