title: Add message to Remote Push Notification in Objective C (iOS)
body: <p>How to fetch and display the message in push notification from dynamic notification service</p>
  
  <pre><code>push: {
      aps =  {
          alert = "My First Notification";
          sound = default;
          Msg = {
              myData = (
                        {
                          Msg = "Awesome";
                          Id = 123;
                          Date = "Jan 18 2018";
                         }
                        );
                };
             };
         }
  </code></pre>
  
  <p>As i want to display alert = "My First Notification" and Msg = "Awesome" when push notification arrives.  I have no idea how to fetch and display. Please help me to solve this issue. TIA</p>
  
  <p>I have tried below code</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      // Override point for customization after application launch.
  
      [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
  
      [application registerForRemoteNotifications];
  
  
      return YES;
  }
  
  - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
  {
      NSLog(@"My token is: %@", deviceToken);
  
      NSString *deviceTokenStr = [[[[deviceToken description]
                                    stringByReplacingOccurrencesOfString: @"&lt;" withString: @""]
                                   stringByReplacingOccurrencesOfString: @"&gt;" withString: @""]
                                  stringByReplacingOccurrencesOfString: @" " withString: @""];
  
      NSLog(@"Device Token: %@", deviceTokenStr);
  }
  
  - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
  {
      NSLog(@"Failed to get token, error: %@", error);
  }
  
  - (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo
  {
      NSLog(@"Received notification: %@", userInfo);
      NSUserDefaults * loginDefaults = [NSUserDefaults standardUserDefaults];
  
      UIApplicationState state = [[UIApplication sharedApplication] applicationState];
      if (UIApplicationStateActive == state )
      {
  
          return;
      }
  
  }
  </code></pre>
  
  <p>I Want to display it in push notification only.</p>