Registering iOS devices for use with Amazon SNS (APNS) through Amazon Anonymous TVM -


Similar queries on Stack Overflow appear many times, with no solution for Amazon SNS.

Indicates that Amazon SNS (APNS) can be completed through an anonymous token vending machine. Provides a template to deploy, which I have used, then specifies an IOS client that uses its usage However, in the template configuration source or in the iOS client instance, I can not see that the TVM from the SNS application allows device entries How to make it connected (referred to as the end point) Any idea where it happens?

The context changes are linked to the client-side. The solution was as follows:

  Include: AWSRuntime.framework AWSSecurityTokenService.framework AWSSNS.framework #define SNS_PLATFORM_APPLICATION_ARN @ "Insert ARN Here" #define TOKEN_VENDING_MACHINE_URL @ "Enter vending machine url, found in the output tab "# USDSL1 # Define Progress Mark - Amazon TVM + (Zero) initSNS {Amazon Credentials * Credentials = [Get Amazon Chaindraffron credentials FraMe Chain]; Sns = [[AmazonSNSClient alloc] initWithCredentials: Credentials]; Sns.endpoint = [AmazonainPoints Points SNDEPoint: US_WEST_2]; [[UIApplication shared applicant] RegisterForreremote Notification type: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound]; } + (Amazon DVMClient *) tvm {if (tvm == blue) {tvm = [[AmazonTVMClient alloc] initWithEndpoint: TOKEN_VENDING_MACHINE_URL UsageSSL: USE_SSL]; } Return TVM; } + (Bull) has credentials {return! [TOKEN_VENDING_MACHINE_URL is extolstration: @ "Change ME"]; } + (Response *) Valid credentials {Enabled * Feedback = Gate token = [[Response all] initWithCode: 200 and Message: @ "OK"]; If ([AmazonKeyChainWrapperCredentialsExpired)] {@Synchronized (self) {If ([AmazonKeyChainWrapper is Reversible]) {Enabled ToGetToken = [[Self-TVM] anonymous registration]; If ([tryToGetToken is successful]) {tryToGetToken = [[Self-TVM] getToken]; If ([enabled toggle token successful]) [[App Delegate initSNS]; }}}}} {[Adeliet Init SNS]; } Return to TwitterToken; } #pragma Icon - Push Notification - (empty) Application: (UIApplication *) Application Received Remover Notice: (NSDictionary *) userInfo {application.applicationIconBadgeNumber = 0; NSString * msg = [NSString stringWithFormat: @ "% @", userInfo]; NSLog (@ "% @", msg); UIAlertView * alertView = [[UIAlertView alloc] initWithTitle: @ "Message Received" Message: [NSString stringWithFormat: @ "% @", msg] Rep: Auto Cancel Button: @ "OK" Other Button Titles: Nil]; [Show warning view]; } - (NSString *) deviceTokenAsString: (NSDT *) deviceTokenData {NSString * rawDeviceTring = [NSString stringWithFormat: @ "% @", DeviceToken_Data]; NSString * noSpaces = [rawDeviceTring string BireReplacingOccurrencesOfString: @ "" withString: @ ""]; NSString * tmp1 = [noSpaces stringbearPlacingUniquelationoffString: @ "& lt;" ] @ "";: WithString return [tmp1 string by replacing occurenceofstring: @ "& gt;" ] @ "";: WithString} - (zero) Application: (UIApplication *) Application: Device token with notification for credentials: (NSDT *) DeviceTokan {NSLOG (@ "Submit Device token [% @] For SNS. ", DeviceToken); SNSCreatePlatformEndpointRequest * platformEndpointRequest = [SNSCreatePlatformEndpointRequest new]; platformEndpointRequest.customUserData = @ "Custom Data is here for the user."; PlatformEndpointRequest.token = [Auto DeviceTokenAstString: DeviceToken]; Platform EindpointRequest.platformApplicationArn = SNS_PLATFORM_APPLICATION_ARN; [Snsplatformendpoint: platformandpoint reserve]; }    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -