I have been implementing Faye
for our IOS
chat application. Since I don’t know much about the IOS
side, I am little bit confused. Every thing works fine but my client asks me to check if IOS
app has received the push message but as far as Faye
is concerned it only checks /meta/disconnect
and /meta/unsubscribe
channel for client deactivation but how do i know that IOS
app goes to background because than I have to send msg through APNS
. But my client doesn’t want to hit Rails API to tell browser about the APP Status. Little bit confused please help me.
You can know your app goes in background when this method from your ApplicationDelegate is called :
- (void)applicationDidEnterBackground:(UIApplication *)application
You can also listen for the UIApplicationDidEnterBackgroundNotification event from any controller :
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(appHasGoneInBackground:)
name:UIApplicationDidEnterBackgroundNotification
object:nil];
Here is a thread that covers this subject :