Pinpoint Push Notification on Ios App Swift Read Payload

iOS Dynamic Push Notifications with AWS Pinpoint

Path to Push button Notifications

Dealing with Certificates

Fill out the information and check "relieve locally on drive"

chose certificates, Identifiers & Profiles

Chose this certificate

Fix Push Notifications for AWS

Search for the "Mobile Hub" in your AWS console.

The ii microservices needed.

Download the Cloud Config and insert it into your XCode project. Download the Swift Modules and insert the DB classes into your XCode project.

Driblet the config file hither

This is how it should look like when it's done.

Send First Push Notifications with AWS

                      func            application(_ awarding: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)            {                    pinpoint!.notificationManager.interceptDidRegisterForRemoteNotifications(          withDeviceToken: deviceToken)                      let            tokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)})                      var            deviceToken = deviceToken.hexEncodedString()                      print("deviceToken: \(deviceToken.hexEncodedString())")                      }                  
          center.requestAuthorization(options: options) { (success, error)            in                                if            success{          print("user granted permission")}                      else            {          impress("user denied permission")          }          }        

Notification Center Instance

Send Push Notifications dynamically

                      //Save a new item                    dynamoDbObjectMapper.save(userItem, completionHandler: {          (error: Error?) -> Void            in                                if            let            fault = error {          print("Amazon DynamoDB Save Mistake: \(fault)")                      return                    }          print("User \(userItem._userName!) has been updated")          })        
                      private            static            func            create_APNS_Body(_            address:String,_            message:PushNotificationInfo)->String {                      let            context = "\north\"Context\":{}"                      let            addresse = "\n\"Addresses\":{\"\(address)\":{\"ChannelType\":\"APNS\"}}"                      let            Endpoints = "\n\"Endpoints\":{}"                      let            apnsBody = "\northward\"Body\":\"\(bulletin.text)\""                      permit            apnsSubs = "\n\"Substitutions\":{}"                      let            apnsTitle = "\n\"Title\":\"\(message.title)\""                      allow            apnsAction = "\n\"Action\":\"OPEN_APP\""                      allow            apnsUrl = "\north\"Url\":\"string\""                      allow            apnsSilentPush = "\n\"SilentPush\":simulated"                      let            apnsData = "\n\"Data\":{}"                      let            apnsBatch = "\n\"Badge\":0"                      let            apnsSound = "\n\"Audio\":\"default\""                      let            APNSMessage = "\northward\"APNSMessage\":"                      permit            MessageConfiguration = "\n\"MessageConfiguration\":"                      permit            open = "{"                      let            close = "}"                      permit            comma = ","                      permit            body = open + context + comma + MessageConfiguration + open + APNSMessage + open up + apnsBody + comma + apnsSubs + comma + apnsTitle + comma + apnsAction + comma + apnsUrl + comma + apnsSilentPush + comma + apnsData + comma + apnsBatch + comma + apnsSound + close + close + comma + addresse + comma + Endpoints + close                      return            torso          }        
          HttpUtils.makeSignedRequestToGraphql(query: body) { (result)            in                    print(result)          }        

manisdayer1946.blogspot.com

Source: https://medium.com/@mouroum.m/ios-push-notifications-with-aws-4bde95dfe7f4

0 Response to "Pinpoint Push Notification on Ios App Swift Read Payload"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel