-
In XCode, in the project navigator, right click
Libraries
->Add Files to [your project's name]
, go tonode_modules/@0x5e/react-native-alipay
and addRCTAlipay.xcodeproj
-
Select your project. Add the following libraries to your project's
Build Phases
->Link Binary With Libraries
:libc++.tbd
libz.tbd
CFNetwork.framework
CoreGraphics.framework
CoreMotion.framework
CoreTelephony.framework
CoreText.framework
Foundation.framework
QuartzCore.framework
SystemConfiguration.framework
UIKit.framework
libRCTAlipay.a
-
Add
alipay
intoLSApplicationQueriesSchemes
inTargets
->info
->Custom iOS Target Properties
, or editInfo.plist
like this:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>alipay</string> <!-- Add this line -->
</array>
- Open up
AppDelegate.m
, implement two methods inAppDelegate
like this:
// ...
#import <React/RCTLinkingManager.h>
@implementation AppDelegate
// ...
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [RCTLinkingManager application:application openURL:url
sourceApplication:sourceApplication annotation:annotation];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
@end
- Create a url type in
Info
->URL Types
. Setalipay
toIdentifier
, set an unique id toURL Schemes
(whatever you like).