réagir-native - Un problème avec React Native iOS AppDelegate.m
迷茫
迷茫 2017-05-31 10:32:55
0
1
904

Ce module est actuellement utilisé dans le projet,pingpp-react-nativeIl a déclaré dans le document que le code suivant doit être ajouté à AppDelegate.m,

//iOS 8 及以下 - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { BOOL canHandleURL = [Pingpp handleOpenURL:url withCompletion:nil]; return canHandleURL; } //iOS 9 及以上 - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { BOOL canHandleURL = [Pingpp handleOpenURL:url withCompletion:nil]; return canHandleURL; }

Mon AppDelegate.m est le suivant Actuellement, seul le code iOS9 a été ajouté. Comment ajouter le code iOS8 Il semble qu'il doive être fusionné avec le code RCTLinkingManager ?

#import "AppDelegate.h" #import  #import  #import  #import "SplashScreen.h" #import "Pingpp.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // 省略 } - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [RCTLinkingManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; } // 我添加的pingpp iOS9相关代码 - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { BOOL canHandleURL = [Pingpp handleOpenURL:url withCompletion:nil]; return canHandleURL; } @end
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

répondre à tous (1)
PHPzhong

Si vous devez vous adapter à iOS8, vous pouvez juger la version de deux manières

    Derniers téléchargements
    Plus>
    effets Web
    Code source du site Web
    Matériel du site Web
    Modèle frontal
    À propos de nous Clause de non-responsabilité Sitemap
    Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!