Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions OAT.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<oatconfig>
<licensefile>LICENSE</licensefile>
<policylist>
<policy name="projectPolicy" desc="">
<policyitem type="license" name="MIT" path=".*" desc="license under the MIT" />
</policy>
<policy name="projectPolicy" desc="">
<policyitem type="compatibility" name="GPL-2.0+" path=".*" desc="Process that runs independently, invoked by the X process." />
<policyitem type="compatibility" name="Apache-2.0" path=".*" desc="不影响兼容性" />
<policyitem type="compatibility" name="BSDStyleLicense" path=".*" desc="不影响兼容性" />
<policyitem type="compatibility" name="MIT" path=".*" desc="不影响兼容性" />
<policyitem type="compatibility" name="GPLStyleLicense" path=".*" desc="不影响兼容性" />
</policy>
</policylist>
<filefilterlist>
<filefilter name="copyrightPolicyFilter" desc="Filters for compatibility,license header policies">
<filteritem type="filepath" name="harmony/douyin/hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不手动修改" />
<filteritem type="filepath" name="harmony/douyin/src/main/cpp/.*" desc="Codegen生成文件,不手动修改" />
<filteritem type="filepath" name="harmony/douyin/src/main/ets/generated/.*" desc="Codegen生成文件,不手动修改" />
<filteritem type="filename" name="*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改" />
<filteritem type="filename" name="*/*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改" />
<filteritem type="filename" name="*.test.tsx" desc="测试文件,不手动修改" />
<filteritem type="filename" name="*.test.ets" desc="测试文件,不手动修改" />
<filteritem type="filename" name="*.config.js" desc="工程配置文件,不手动修改" />
<filteritem type="filename" name="*.nvmrc" desc="工程配置文件,不手动修改" />
<filteritem type="filename" name=".prettierrc.js" desc="工程配置文件,不手动修改" />
<filteritem type="filename" name=".yarnrc" desc="工程配置文件,不手动修改" />
<filteritem type="filename" name="yarn.lock" desc="工程配置文件,不手动修改" />
<filteritem type="filename" name=".npmignore" desc="工程配置文件,不手动修改" />
<filteritem type="filename" name=".ohpmignore" desc="工程配置文件,不手动修改" />
<filteritem type="filename" name="LICENSE" desc="版权文件,不添加版权头" />
<filteritem type="filepath" name="src/*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险" />
<filteritem type="filepath" name="src/*.ts" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险" />
<filteritem type="filepath" name="*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险" />
<filteritem type="filepath" name="*.ts" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险" />
<filteritem type="filepath" name="index.*" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险" />
<filteritem type="filename" name=".npmrc" desc="配置文件,不修改版权头" />
</filefilter>

<filefilter name="binaryFileTypePolicyFilter" desc="Filters for copyright header policies">
<filteritem type="filepath" name="harmony/douyin.har" desc="项目打包文件" />
</filefilter>
</filefilterlist>
</oatconfig>
</configuration>
11 changes: 11 additions & 0 deletions README.OpenSource
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"Name": "react-native-douyin",
"License": "MIT License",
"License File": "https://github.com/wiseqingyang/react-native-douyin/blob/master/LICENSE",
"Version Number": "1.1.4",
"Owner" : "panjinling@huawei.com",
"Upstream URL": "https://github.com/wiseqingyang/react-native-douyin",
"Description": "Tool library for initialization, authorization and sharing of Tiktok sdk"
}
]
141 changes: 7 additions & 134 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,140 +1,13 @@
# react-native-douyin-lib
# @react-native-ohos/react-native-douyin-lib

## Getting started
This project is based on [react-native-douyin@1.1.4](https://github.com/wiseqingyang/react-native-douyin/tree/v1.1.4)

`$ npm install react-native-douyin-lib --save`
## Documentation

### Mostly automatic installation
- [中文](https://gitcode.com/OpenHarmony-RN/usage-docs/blob/master/zh-cn/react-native-douyin.md)

RN > 0.59 you need do nothing
- [English](https://gitcode.com/OpenHarmony-RN/usage-docs/blob/master/en/react-native-douyin.md)

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>
```

3. 配置你的App与抖音短视频通讯的 URLScheme,即申请到的appKey

4. 分享的图片通过相册进行跨进程共享手段,如需使用分享功能,还需要填相册访问权限,在 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文件中添加:

```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
```javascript
import Douyin from 'react-native-douyin-lib';
```

#### init(appKey) 注册

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

- `appKey` {String}

#### auth(scope,state) 注册

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

- `state` {String} 目前无用

成功的返回:

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

#### shareVideo(config) 注册
该方法目前不完善,后续完成

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

This library is licensed under [The MIT License (MIT)](https://github.com/wiseqingyang/react-native-douyin/blob/master/LICENSE)
14 changes: 0 additions & 14 deletions android/README.md

This file was deleted.

33 changes: 0 additions & 33 deletions android/build.gradle

This file was deleted.

35 changes: 0 additions & 35 deletions android/src/main/AndroidManifest.xml

This file was deleted.

28 changes: 0 additions & 28 deletions android/src/main/java/com/ainuo/douyin/DouyinCallbackActivity.java

This file was deleted.

Loading