EzDevInfo.com

push-notification interview questions

Top push-notification frequently asked interview questions

Generate .pem file Used to setup Apple PUSH Notification

I tried and tried to generate .pem file , every time generating certificates from client's account and then generating .pem file using terminal, but its of no use. i followed many links for the same. please help me if any one have any idea about how to generate .pem or have any link that gives a step by step procedure for .pem generation.


Source: (StackOverflow)

Apple PNS (push notification services) sample code

Is there a sample project showing how to use APNS on the IPhone and how to set up things? I'm currently looking at the documentation but it would be nice to have some working code to pick apart and see how it all works together?

I can't seem to find anything using google or in the iphone dev center.


Source: (StackOverflow)

Advertisements

Get push notification while App in foreground iOS

I am using push notification service in my app. When application is in background I am able to see notification on notification screen(screen shown when we swipe down from top of iOS device). But if application is in foreground the delegate method - (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo is getting called but notification is not displayed in notification screen.

I want to show notification on notification screen independent of whether application is in background or foreground. I am tired by searching for a solution..... Any help is greatly appreciated....


Source: (StackOverflow)

Android Push Notification (GCM), is there any Daily Limit?

Is there any daily limit for number push notifications (GCM) can be sent to a particular android application user?


Source: (StackOverflow)

Android: Test Push Notification online (Google Cloud Messaging)

I am implementing Google Cloud Messaging in my application. Server code is not ready yet and in my environment due to some firewall restrictions I can not deploy a test sever for push notification. What I am looking for is a online server which would send some test notifications to my device to test my client implementation.


Source: (StackOverflow)

What is the maximum length of a Push Notification alert text?

What is the maximum length of the alert text of an iOS push notification?

The documentation states that the notification payload has to be under 256 bytes in total, but surely there must be a specific character limit for the alert text.


Source: (StackOverflow)

Reset push notification settings for app

I am developing an app with push notifications. To check all possible ways of user interaction, I'd like to test my app when a user declines to have push notifications enabled for my app during the first start.

The dialog (initiated by registerForRemoteNotificationTypes), however, appears only once per app. How do I reset the iPhone OS's memory of my app. Deleting the app and reinstalling doesn't help.


Source: (StackOverflow)

How to fix "no valid 'aps-environment' entitlement string found for application" in Xcode 4.3?

I've been trying very very hard to create a simple simple iOS app which can recieve push notifications. My only reason for doing this is to establish a procedure for some other team members to use, and have not been able to find an up to date, working version of such instructions elsewhere on the web. Our shop is fairly new to iOS dev, I personally am completely inexperienced with iOS dev and Xcode. I've stumbled through tens of tutorials, articles, and trouble posts from Apple and elsewhere and I feel like I might be nearly there...

Here is where I've got to (note I'm using Xcode 4.3 and trying initially to deploy just to iOS 5.1, and I gather that some things may have changed recently vs earlier versions of Xcode, but again I'm new to all this -- and finding it completely confusing and convoluted):

1) I've got a provisioning profile on my iPhone which has Push enabled

2) In my test Xcode project I've got that provisioning profile selected as the signing identity (in Build Settings > Code Signing)

enter image description here

3) I've got my bundle identifier under Summary and Info > Custom iOS Target Properties set properly* (I think??)

4) I've got registerForRemoteNotificationTypes being called in my delegate's didFinishLaunchingWithOptions

5) I've got didRegisterForRemoteNotificationsWithDeviceToken and didFailToRegisterForRemoteNotificationsWithError in my delegate, set up to log the device token or error respectively

6) I've got Enable Entitlements checked under Summary.

7) Right below that the Entitlements File selected is Tinker6 (the name of my test project), which was generated automatically when I checked Enable Entitlements

8) In the Tinker6.entitlements file I've got the following (which I've gathered is correct based on several different posts all over the web, but which I can't find anything definitive from Apple itself on):

enter image description here

Updated

9) Also, I have tried the whole thing without an entitlements file, and get essentially the same result.

10) My mobileprovision file contents include entitlements properly (I've scrambled the number and domain but structurally the same):

<key>application-identifier</key>
<string>12355456A7.com.whatever.tinker</string>
<key>aps-environment</key>
<string>development</string>
<key>get-task-allow</key>
<true/>
<key>keychain-access-groups</key>
<array>
    <string>12355456A7.*</string>
</array>

/end update

When I attempt to run this on my device, I get the following error in Xcode output:

2012-06-11 12:45:23.762 Tinker6[13332:707] Failed to get token, error: 
Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' 
entitlement string found for application" UserInfo=0x24a3b0 
{NSLocalizedDescription=no valid 'aps-environment' entitlement string 
found for application}

I've tried setting get-task-allow to NO, aps-environment to production, all four possible combinations, same thing.

How can I get past this? Where is definitive documentation on this?

-- further background follows --

*As far as the bundle id, I am still not clear on how this should be set in relation to App Ids and Profile ids in the Provisioning profile. In the Provisioning portal under App Ids I have this (again, scrambled the number and domain):

enter image description here

And the two places bundle id is set I have this:

enter image description here enter image description here

I am not at all sure these are correct or whether one or both should be set to 12355456A7.com.whatever.tinker, though I've tried those earlier in the process with no success...

Note I realize there are many posts with similar titles, however they all seem to be out of date based on the file names and so-forth given, and the fact none of the solutions seem to be useful. I'm hoping the greater level of detail I've given will warrant a quality response. I will probably assign a bounty as soon as possible and if you give a high quality answer that leads to a solution I will award you the bounty as well as promote your answer via twitter and my blog. Especially if you crosspost post a really good "here are the exact 500 steps you need to get a simple push notification app working including provisioning and whatever else" article on your blog or whatever.


Source: (StackOverflow)

"no valid aps-environment entitlement found for application"

I am encountering this error when I am loading an Ad Hoc build of my Push Notification enabled iPhone app onto my device:

no valid aps-environment entitlement found for application

What does it mean, and how do I repair it?


Source: (StackOverflow)

Does Android support near real time push notification?

I recently learned about the ability of iPhone apps to receive nearly instantaneous notifications to apps notifications to apps.

This is provided in the form of push notifications, a bespoke protocol which keeps an always on data connection to the iPhone and messages binary packets to the app, which pops up alerts incredibly quickly, between 0.5 - 5 seconds from server app send to phone app response time. This is sent as data - rather than SMS - in very very small packets charged as part of the data plan not as incoming messages.

I would like to know if, using Android, there is either a similar facility, or whether it's possible to implement something close to this using Android APIs. To clarify, I define similar as:

  • Not an SMS message, but some data driven solution
  • As real time as is possible
  • Is scalable, i.e., as the server part of a mobile app, I could notify thousands of app instances in seconds

I appreciate the app could be pull based, HTTP request/response style, but ideally I don't want to be polling that heavily just to check for notification; besides which it's like drip draining the data plan.


Source: (StackOverflow)

Will iOS launch my app into the background if it was force-quit by the user?

I am triggering a background fetch by using the content-available flag on a push notification. I have the fetch and remote-notification UIBackgroundModes enabled.

Here is the implementation I am using in my AppDelegate.m:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
    NSLog(@"Remote Notification Recieved");
    UILocalNotification *notification = [[UILocalNotification alloc] init];
    notification.alertBody =  @"Looks like i got a notification - fetch thingy";
    [application presentLocalNotificationNow:notification];
    completionHandler(UIBackgroundFetchResultNewData);

}

When the app is running in the background, it works fine. (The notification is received and the app triggered the "looks like i got a notification" local notification, as the code above should do).

However, when the app is not running and a push notification is received with the content-available flag, the app is not launched and the didRecieveRemoteNotification delegate method is never called.

The WWDC Video Whats New With Multitasking (#204 from WWDC 2013) shows this: enter image description here

It says that the application is "launched into background" when a push notification is received with the content-available flag.

Why is my app not launching into the background?

So the real question is:

Will iOS perform background tasks after the user has force-quit the app?


Source: (StackOverflow)

How does push notification technology work on Android?

How has Google implemented their push notification feature? Does it work through polling done by a service running in the background or in a different way?


Source: (StackOverflow)

Debugging App When Launched by Push Notification

I am currently developing an app that receives Push Notifications. I have this all working 100% through a PHP page. There are several different types of push notifications my app can receive. The PHP handles this and sends different packets of information to my app which are all received just fine.

However, when the users "views" the notification and my app launches, I obviously want to take a different action than I would if the user just launched the app manually - and on top of that, different actions depending on the push notification type. I have got this working fine... structurally.

One of my push types is supposed to open a UIView that makes several connections to several different servers and negotiates data back and forth. This UIView works fine when, for example, triggered from the main menu - however when my push notification is triggering this UIView to appear, the socket connections are not acting as expected.

Now my question is not about the sockets, but more so - How do you debug such a problem?? From what I can tell (I am relatively new) when the app launched from a push notification there is no way to link that execution to the debugger / console / etc... I am having a very difficult time trying to debug the code using UIAlertViews, as there are many lines of communication back and forth between the various servers.

Any advice you have for me would be greatly appreciated.


Source: (StackOverflow)

Handling registration ID changes in Google Cloud Messaging on Android

In the docs on Google Cloud Messaging, it states:

The Android application should store this ID for later use (for instance, to check on onCreate() if it is already registered). Note that Google may periodically refresh the registration ID, so you should design your Android application with the understanding that the com.google.android.c2dm.intent.REGISTRATION intent may be called multiple times. Your Android application needs to be able to respond accordingly.

I register my device using the following code:

GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String regID = gcm.register(senderID);

The GoogleCloudMessaging class encapsulates the registration process. So how am I suppose to handle com.google.android.c2dm.intent.REGISTRATION since handling that is done internally by the GoogleCloudMessaging class?


Source: (StackOverflow)

Socket.IO documentation

Is there any documentation about Socket.IO? Its website just has a poor wiki and there is no full documentation explaining connect, emit, require and so on


Source: (StackOverflow)