1.0.0 • Published 6 years ago
@opendt/react-native-opensdk v1.0.0
React Native MobShareSDK
react-native wrapper of Mob ShareSDK, support both ios and android.
Note, this library only support react-native 0.60+
Installation
Install library via npm:
npm install --save @opendt/react-native-timTo complete the linking on iOS, run:
cd ios && pod installAdditional steps
Android
create an
opensdk.gradlefile underandroid/appfolder, and add following MobSDK config:MobSDK { appKey "MobSDK appKey" appSecret "MobSDK appSecret" ShareSDK { gui false devInfo { Wechat { appId "xxx" appSecret "xxx" withShareTicket true bypassApproval false } ... } } }For available options, see this official example
register MobSDK in project's build.gradle file:
dependencies { // Register MobSDK classpath "com.mob.sdk:MobSDK:2018.0319.1724" }add MobSDK plugin to app module's build.gradle file:
apply plugin: "com.mob.sdk"
iOS
- update your
AppDelegate.mfile:+ #import "DTOpenSDK.h" - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // ... + [[DTOpenSDK sharedInstance] setupShareSDK:@{ + @"wechat": @{ + @"appId": @"xxx", + @"appSecret": @"xxx", + @"universalLink": @"xxx", + }, + }]; return YES; } - add
LSApplicationQueriesSchemeskey inInfo.plistfile - add
MobAppKeyandMonAppSecretinInfo.plistfile - config
URL SchemeinInfo.plistfile - config
URL Types - config
Universal Links
1.0.0
6 years ago