0

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.

Braham Shakti
  • 1,408
  • 4
  • 22
  • 39

1 Answers1

0

You can know your app goes in background when this method from your ApplicationDelegate is called :

- (void)applicationDidEnterBackground:(UIApplication *)application

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIApplicationDelegate_Protocol/Reference/Reference.html

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 :

Use of background/foreground methods in AppDelegate

Community
  • 1
  • 1
vdaubry
  • 11,369
  • 7
  • 54
  • 76