@opendt/react-native-opensdk

1.0.0 • Public • Published

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

  1. create an opensdk.gradle file under android/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

  2. register MobSDK in project's build.gradle file:

     dependencies {
         // Register MobSDK
         classpath "com.mob.sdk:MobSDK:2018.0319.1724"
     }
  3. add MobSDK plugin to app module's build.gradle file:

    apply plugin: "com.mob.sdk"

iOS

  1. 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;
       }
  2. add LSApplicationQueriesSchemes key in Info.plist file
  3. add MobAppKey and MonAppSecret in Info.plist file
  4. config URL Scheme in Info.plist file
  5. config URL Types
  6. config Universal Links

Package Sidebar

Install

npm i @opendt/react-native-opensdk

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

5.24 MB

Total Files

1350

Last publish

Collaborators

  • wangxinyu1
  • yeoyang