问题说明:
我正在使用此AWS Amplify 文档在我的 React-Native 应用程序中实现推送通知,并且使用 iOS 部分进行测试失败并显示错误“不变违规:本机模块不能为空”,但是如果我测试(即获取设备令牌并发送推送通知)它工作的 Android 部分。我在 iOS 上看到的错误截图如下所示:
到目前为止我尝试过的:
根据this github post,我还尝试安装以下内容:
@react-native-community/push-notification-ios
npm 安装 aws-amplify@unstable
这个模块 ( aws-amplify@unstable ) 引入了一个错误,说TypeError: undefined is not an object (evaluating '_core.Amplify.register')所以我决定摆脱它。
目前我已经离开了我的 package.json 如下:
"dependencies": {
"@aws-amplify/pushnotification": "^1.1.4",
"@aws-amplify/analytics": "^1.3.3",
"@react-native-community/netinfo": "^5.7.0",
"@react-native-community/push-notification-ios": "^1.2.0",
"amazon-cognito-identity-js": "^4.2.1",
"aws-amplify": "^1.2.4",
"aws-amplify-react-native": "^4.2.0",
"axios": "^0.19.2",
"cache": "^2.3.1",
"react": "16.9.0",
"react-native": "^0.62.2"
} …Run Code Online (Sandbox Code Playgroud) 我正在尝试将 AWS 推送通知服务与 IOS 平台集成,但从控制台发送通知时出现未注册或过期令牌错误。
我已通过亚马逊 API 注册了设备,该设备显示活动状态。遵循创建 SSL 证书、设置 AWS SDK 的所有步骤,也尝试生成不同的生产证书和沙箱证书。
var pinpoint: AWSPinpoint?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
registerForPushNotifications()
/** start code copy **/
// Create AWSMobileClient to connect with AWS
AWSMobileClient.sharedInstance().initialize { (userState, error) in
if let error = error {
print("Error initializing AWSMobileClient: \(error.localizedDescription)")
} else if let userState = userState {
print("AWSMobileClient initialized. Current UserState: \(userState.rawValue)")
}
}
// Initialize Pinpoint
let pinpointConfiguration = AWSPinpointConfiguration.defaultPinpointConfiguration(launchOptions: launchOptions)
pinpoint = …Run Code Online (Sandbox Code Playgroud) 我正在使用 AWS Translate 构建 POC,要求之一是使用 REST API。
我构建了以下网址:
但是当我使用 POSTMAN 点击 url 时,出现以下错误:
{
"__type": "UnknownOperationException"
}
Run Code Online (Sandbox Code Playgroud)