Je reçois une erreur pendant que j'essaye d'obtenir le défautSNS de AWSSNS. Il dit:Comment configurer Info.Plist pour obtenir AWSSNS.defaultSNS fonctionne
'NSInternalInconsistencyException', reason: 'The service configuration
is `nil`. You need to configure `Info.plist` or set `defaultServiceConfiguration`
before using this method.'
Je travaille sur un exemple de fichier téléchargé à partir de la page d'intégration MobileHub et mon code est placé à l'intérieur PushNotificationViewController. C'est comme ci-dessous:
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)
}