0
Я получаю сообщение об ошибке, пока пытаюсь получить defaultSNS от AWSSNS. Он говорит:Как установить Info.Plist, чтобы получить работу AWSSNS.defaultSNS
'NSInternalInconsistencyException', reason: 'The service configuration
is `nil`. You need to configure `Info.plist` or set `defaultServiceConfiguration`
before using this method.'
Я работаю на образце файла, загруженного с страницы интеграции MobileHub, и мой код помещается внутри PushNotificationViewController. Это как указано ниже:
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)
}