title: How to play sound when receiving a Push notification in iPhone
body: <p>Hi I am trying to play the default Push sound when receiving a Push Notification on my iDevice I used this code to play the sound in the </p>
  
  <pre><code>-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo` Method 
  
  NSDictionary *test =(NSDictionary *)[userInfo objectForKey:@"aps"];
      NSString *alertString =(NSString *) [test objectForKey:@"alert"];
      NSLog(@"String recieved: %@",alertString);
      if (state == UIApplicationStateActive) {
              UIAlertView *alertmessage=[[UIAlertView alloc]initWithTitle:@"iEverything Tech"
                                                                  message:alertString                                                    delegate:self
                                                 cancelButtonTitle:@"OK"
                                                 otherButtonTitles:nil];
  
  
              [alertmessage show];
  
              AudioServicesPlaySystemSound(1002);
  
  
          }
  
          if (state == UIApplicationStateInactive) {
              AudioServicesPlaySystemSound(1002);
          }
  
          if (state == UIApplicationStateBackground) {
              AudioServicesPlaySystemSound(1002);
          }
  </code></pre>
  
  <p>And my second question is how to show the Pushed message in the AlertView?</p>
  
  <p>Thank you for your answers!</p>
  
  <p>And I can't use a Push provider like Parse because we hour own server and we need to push automatically</p>