0
AWSSNSからdefaultSNSを取得する際にエラーが発生します。それは言う:私はMobileHub統合ページからダウンロードしたサンプルファイルに取り組んでいる、と私のコードがPushNotificationViewControllerの内側に配置されてInfo.Plistを設定してAWSSNS.defaultSNSを取得する方法
'NSInternalInconsistencyException', reason: 'The service configuration
is `nil`. You need to configure `Info.plist` or set `defaultServiceConfiguration`
before using this method.'
。以下のようになります。
override func viewDidLoad() {
super.viewDidLoad()
let pushManager: AWSPushManager = AWSPushManager.defaultPushManager()
pushManager.delegate = self
pushManager.registerForPushNotifications()
pushNotificationSwitch.on = pushManager.enabled
if let topicARNs = pushManager.topicARNs {
pushManager.registerTopicARNs(topicARNs)
}
let someDict:[String:String] = ["CustomUserData":"This is test data"]
var attr = AWSSNSSetEndpointAttributesInput()
attr.attributes = someDict
attr.endpointArn = "arn:aws:sns:xxxxxxxx"
let defSns = AWSSNS.defaultSNS() <-- Error is here
defSns.setEndpointAttributes(attr)
}