Avijit Nagare Avijit Nagare - 5 months ago 10
Swift Question

Remote Notification not adding in iPhone Notification Center in iOS 9

My notification working when app is Active.

I have enable background mode 1.Background Fetch. 2. Remote Notification
App Delegate look like

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
//rest of code

completionHandler(UIBackgroundFetchResultNewData);
}


Also, Paylaod look like

{
aps={ "content-available"=1;
message="asdf"
};

}


Notification in app state as follows


Active= Working

Background= Received but not added in notification center i need to
manually click on app.(I can't see it in device notification center)

Closed: Not working (Expected to add in Notification center).


I tested by re-starting device,
What could be the issue?

Is it due to absence of "alert","sound" in payload?

Answer

Yes, you need an alert value, otherwise there's nothing to display in the Notification Center.

The Remote Notification Payload

Comments