@opendt/react-native-opensdk
v1.0.0
Published
react-native port of Mob ShareSDK, support both ios and android.
Downloads
7
Readme
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-tim
To complete the linking on iOS, run:
cd ios && pod install
Additional steps
Android
create an
opensdk.gradle
file underandroid/app
folder, 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.m
file:+ #import "DTOpenSDK.h" - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // ... + [[DTOpenSDK sharedInstance] setupShareSDK:@{ + @"wechat": @{ + @"appId": @"xxx", + @"appSecret": @"xxx", + @"universalLink": @"xxx", + }, + }]; return YES; }
- add
LSApplicationQueriesSchemes
key inInfo.plist
file - add
MobAppKey
andMonAppSecret
inInfo.plist
file - config
URL Scheme
inInfo.plist
file - config
URL Types
- config
Universal Links