npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-douyin-lib

v1.1.4

Published

抖音登录、分享

Downloads

7

Readme

react-native-douyin-lib

Getting started

$ npm install react-native-douyin-lib --save

Mostly automatic installation

RN > 0.59 you need do nothing

else

$ react-native link react-native-douyin

Manual installation

iOS

  1. pod 'react-native-douyin-lib', :path => '../node_modules/react-native-douyin-lib/react-native-douyin-lib.podspec'

  2. 为了保证可以正常唤起抖音短视频,在 info 标签栏的Custom iOS Target Properties中找到 LSApplicationQueriesSchemes 如果没有点击“+”添加一个并设置 Key 为LSApplicationQueriesSchemes, Value 类型为数组,将如下配置粘贴到数组中:

<key>LSApplicationQueriesSchemes</key>
<array> 
<string>douyinliteopensdk</string>
<string>snssdk1128</string>
<string>douyinsharesdk</string>
<string>douyinopensdk</string>
</array>
  1. 配置你的App与抖音短视频通讯的 URLScheme,即申请到的appKey

  2. 分享的图片通过相册进行跨进程共享手段,如需使用分享功能,还需要填相册访问权限,在 info 标签栏中添加 Privacy - Photo Library Usage Description,具体请参考抖音开平台。

5.初始化以及UIApplicationDelegate部分# 在AppDelegate中引入DouyinOpenSDKApplicationDelegate.h头文件 并在 App 启动、收到 Open URL 打开 App 时调用 SDK 进行处理

#import<DouyinOpenSDK/DouyinOpenSDKApplicationDelegate.h>

@implementation AppDelegate



- (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
 
 if ([[DouyinOpenSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey]]
        ) {
 return YES;
    }
 
 return NO;
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
 
 if ([[DouyinOpenSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]) {
 return YES;
    }
 
 return NO;
}
 
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
 if ([[DouyinOpenSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:nil annotation:nil]) {
 return YES;
    }
 return NO;
}
@end

Android

  1. React Native 0.60以上会自动链接,其他请手动集成

  2. 如遇sdk下载失败,在 project 级别 build.gradle文件中添加:

    allprojects {
    	 repositories {
    		   ...
            maven { url 'https://dl.bintray.com/aweme-open-sdk-team/public' }
    	 }
    }
  3. 若您的应用的代码存在混淆,若在混淆的情况下存在不能吊起分享的情况,请在您的proguard文件中添加 -keep class com.bytedance.sdk.open.aweme.**

4.请确申请信息的准确性,如包名、md5等

Usage

import Douyin from 'react-native-douyin-lib';

init(appKey) 注册

App 启动后合理的地方初始化。

  • appKey {String}

auth(scope,state) 注册

  • scope {String} 请参考抖音开放平台,如'user_info'

  • state {String} 目前无用

成功的返回:

interface  IResponse {
   msg: string;
   code: number;
   data: {
      authCode: string;
      state: string;
   }
}

shareVideo(config) 注册

该方法目前不完善,后续完成

interface IShareVideoConfig {
   videos: string[]; // 本地路径
   isPublish: boolean; // 是否跳转到发布页
   title: string; // 标题
   shortTitle: string; // 短标题
}

|