Snippet
When the push notification is received, the didReceiveRemoteNotification method of the App Delegate is called and one can make the phone vibrate invoking the AudioServicesPlaySystemSound method.
- /**
- * Remote Notification Received while application was open.
- */
- -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
- #if !TARGET_IPHONE_SIMULATOR
- NSString *sound =[apsInfo objectForKey:@"sound"];
- NSLog(@"Received Push Sound: %@", sound);
- AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
- #endif
- }