React native I';在react native(android)项目中,我没有收到来自AWS Pinpoint的推送通知
我遵守了官方的规定,但无法在我的设备上接收推送通知 我的步骤:React native I';在react native(android)项目中,我没有收到来自AWS Pinpoint的推送通知,react-native,react-native-android,aws-amplify,aws-pinpoint,React Native,React Native Android,Aws Amplify,Aws Pinpoint,我遵守了官方的规定,但无法在我的设备上接收推送通知 我的步骤: 我的Firebase项目配置正确,我能够从Firebase控制台接收推送通知 我在AWS Pinpoint控制台中启用了推送通知,并在那里添加了API密钥和发送者ID 我在项目中执行了以下命令: npm安装@aws放大/pushnotification——保存 react native link@aws放大/pushnotification 在App.js中添加了分析和推送通知的配置 添加到App.js方法onRegister中的c
npm安装@aws放大/pushnotification——保存
react native link@aws放大/pushnotification
App.js方法onRegister
中的componentDidMount中:
updateEndpoint
方法:我错过了什么?如何让它工作 你解决了这个问题吗?@desoss没有,我最终使用OneSignal库来发送推送通知。
Amplify.configure({
Auth: {
region: 'xxx',
userPoolId: 'xxx',
userPoolWebClientId: 'xxx',
mandatorySignIn: true
},
API: {
endpoints: [{
name: "xxx",
endpoint: "xxxx",
custom_header: async () => ({ Authorization: await getAuthorizationToken() })
}]
},
Analytics: {
disabled: false,
AWSPinpoint: {
appId: 'xxxxxx',
region: 'xxxx',
}
}
});
PushNotification.configure({
appId: 'xxxx',
region: 'xxxx',
});
componentDidMount(){
PushNotification.onRegister((token) => {
console.log('in app registration', token);
});
}
Analytics.updateEndpoint({
address: 'xxxx',
channelType: 'GCM',
userId: '1',
})