
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-sc-share
Advanced tools
集成umeng分享模块,支持微信,微信朋友圈,QQ,QQ朋友圈,支付宝分享
$ npm install react-native-sc-share --save
在包名目录下创建wxapi文件夹,新建一个名为WXEntryActivity的activity继承WXCallbackActivity
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths "/>
</provider>
在res/xml目录(如果没有xml目录,则新建一个)下,添加文件filepaths.xml,内容如下:
<?xml version="1.0" encoding="utf-8"?>
<paths>
<root-path name="opensdk_root" path=""/>
<external-files-path name="umeng_cache" path="umeng_cache/"/>
</paths>
在包名目录下创建apshare文件夹,新建一个名为ShareEntryActivity的activity继承ShareCallbackActivity
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
在res/xml目录(如果没有xml目录,则新建一个)下,添加文件filepaths.xml,内容如下:
<root-path name="opensdk_root" path=""/>
<external-files-path name="opensdk_external" path="Images/tmp"/>
在app/build.gradle中添加如下代码:
android {
defaultConfig {
manifestPlaceholders = [qqappid: "qq的appid"]
}
}
import {Share,SHARE_PLATFORM} from 'react-native-share'
Share.preInit({
appkey:appkey, //appkey,必填
channel: channel //渠道,可选
});
Share.init({
isDebug:true, //调试模式是否打开,可选
appkey:appkey, //appkey,必填
wx:{ //微信配置,可选
appId: "", //appId
appSecret:"" //appSecret
},
qq:{ //qq配置,可选
appId: "", //appId
appSecret:"" //appSecret
},
ali:{ //支付宝配置,可选
appId:"" //appId
}
});
Share.share({
title:"", //标题
desc:"", //描述
url:"", //链接
img:"", //图片
platform:SHARE_PLATFORM.WEIXIN, //平台
wx:{ //微信小程序配置,可选
miniId:"", //小程序id
path:"" //小程序路径
},
qq: { //QQ小程序配置,可选
miniId: "", //小程序id
path: "", //小程序路径
}
}).then(res=>{
console.log(res)
}).catch(err=>{
console.log(err)
})
Share.shareWithPanel({
title:"", //标题
desc:"", //描述
url:"", //链接
img:"", //图片
platforms:[SHARE_PLATFORM.WEIXIN,SHARE_PLATFORM.WEIXIN_CIRCLE,SHARE_PLATFORM.ALIPAY, SHARE_PLATFORM.QQ], //需要显示的平台
wx:{ //微信小程序配置,可选
miniId:"", //小程序id
path:"" //小程序路径
},
qq: { //QQ小程序配置,可选
miniId: "", //小程序id
path: "", //小程序路径
},
ali:{ //支付宝小程序配置,可选
scheme: string; //小程序scheme,会替换url,场景:分享链接跳转支付宝小程序指定页面
}
}).then(res=>{
console.log(res)
}).catch(err=>{
console.log(err)
})
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.