Код: Выделить всё
│ Category │ Resource name │ Operation │ Provider plugin │
│ Auth │ userPoolGroups │ No Change │ awscloudformation │
│ Auth │ Rent │ No Change │ awscloudformation │
│ Analytics │ RentAppIOS │ No Change │ awscloudformation │
│ Notifications │ RentAppIOS │ No Change │ │
Код: Выделить всё
AWSPinpointProvider - updateEndpoint failed [TypeError: Cannot read property 'byteLength' of undefined]
Код: Выделить всё
const registerForPushNotifications = async () => {
const { attributes: {sub} } = await Auth.currentUserInfo();
if (sub) {
DeviceInfo.getDeviceToken().then((deviceToken) => {
Analytics.updateEndpoint({
address: deviceToken,
optOut: "NONE",
userId: sub,
channelType: "APNS",
}).then(() => {
console.log("Endpoint created");
}).catch((error) => {
console.log('Error updating endpoint', error);
});
});
}
}
Код: Выделить всё
Amplify.configure({
...awsconfig,
Analytics: {
disabled: false,
},
Predictions: {
provider: AmazonAIPredictionsProvider,
region: awsconfig.aws_mobile_analytics_app_region,
},
});
Analytics.configure({
...awsconfig,
AWSPinpoint: {
region: awsconfig.aws_mobile_analytics_app_region,
},
});
PushNotification.configure({
...awsconfig,
onNotification: function (notification) {
console.log('NOTIFICATION:', notification);
Alert.alert(
notification.title,
notification.body,
[{ text: 'OK' }],
{ cancelable: false }
);
notification.finish("backgroundFetchResultNewData");
},
permissions: {
alert: true,
badge: true,
sound: true,
},
popInitialNotification: true,
requestPermissions: true,
});
Код: Выделить всё
const awsmobile = {
aws_project_region: "eu-west-2",
aws_cognito_identity_pool_id: "eu-west-2:xxxxxxxx-c514-4431-91c0-xxxxxxxx",
aws_cognito_region: "eu-west-2",
aws_user_pools_id: "eu-west-2_xxxxxxxx",
aws_user_pools_web_client_id: "xxxxxxxxxxxxxxxxxxx2m5pmf",
aws_pinpoint_id: "b6846xxxxxxxxxxxxxxxxxxxxxxxxxxx",
aws_mobile_analytics_app_id: "xxxxxxxxxxete",
aws_mobile_analytics_app_region: "eu-west-2",
aws_mobile_analytics_app_title: "Rent",
aws_mobile_analytics_auto_session_record: true,
aws_mobile_analytics_disabled: false
};
export default awsmobile;

Подробнее здесь: https://stackoverflow.com/questions/758 ... -typeerror