title: Using amazon AWS SNS service IOS
body: <p>I am developing an app which uses amazon aws service and it is a messenger.</p>
  
  <p>I would like to use IOS Push Notification service and the amazon SNS to achieve the communication between 2 users. I am able to send message from the SNS console by publishing a message to the destination called endpoint.</p>
  
  <p>However, i am not able to send message from one mobile to another mobile by amazon SDK of IOS. Can i do it in that way by the API of Amazon?</p>
  
  <p>I want to send the NSDictionary called messageDict to the destination endPoint. Can i achieve this without the use of server?? </p>
  
  <pre><code>NSDictionary *messageDict = [[NSDictionary alloc]init];
  
  messageDict = @{ @"Name" : @"HelloWrold" ,@"Id" :@"GoodBye",};
  
  NSData *jsonData = [NSJSONSerialization dataWithJSONObject:messageDict options:NSJSONWritingPrettyPrinted error:nil];
  
  NSString *jsonString = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];
  
  
  NSLog(@"Jsonstring %@",jsonString);
  
  AWSSNS *publishCall = [AWSSNS new];
  
  AWSSNSPublishInput *message = [AWSSNSPublishInput new];
  
  message.subject = @"My First Message";
  
  
  //This is the ending point
  message.topicArn = @"arn:aws:sns:us-east-1:012345678912:endpoint/APNS_SANDBOX/appTesting/201sjad-XXXX-XXXX-XXXX-c34sdfdsf1d9c";
  
  message.messageAttributes = messageDict;
  
  message.messageStructure = jsonString;
  
  
  
  
  [[publishCall publish:message]continueWithExecutor:[BFExecutor mainThreadExecutor] withBlock:^id(BFTask *task){
  
      if (task.error != nil) {
          NSLog(@"Error %@",task.error);
  
      }
  
  
      else{
  
  
  
          NSLog(@"Successful");
  
      }
  
      return nil;
  
  }];
  </code></pre>