Opening notification on specific index - objective-c

I have an app with multiple folders. One of the folders is set with a location reminder. When I enter the region I get a notification alert. Up to this, it's working well.
Now when I tap the notification the App opens but I want to open the specific folder that triggers on entering the region. How can I implement this to work?
Should I use the notification delegate method?
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler API_AVAILABLE(ios(7.0));
If so should I get a new certificate with Push notification enabled? Please suggest me with a solution.

Put the folder path into userInfo with a custom key can help. Delegate method is depends on the framework you are using. It can be implemented as a local notification, so the certificate is not necessary.

Related

Remote Notification in iOS 8 (non User Notification)

In iOS 8, even without user's explicit permission, remote notifications can be sent to user's device. So I'm trying to use this and remote-notification background mode to wake up the app by sending remote push notifications.
I confirmed that this works by registering for remote notification only and not for user notifications. (-registerUserNotificationSettings)
[application registerForRemoteNotification];
I have implemented the following delegate method.
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
However, it seems like it only works when the app is in foreground.
According to the doc,
Use this method to process incoming remote notifications for your app. Unlike the application:didReceiveRemoteNotification: method, which is called only when your app is running in the foreground, the system calls this method when your app is running in the foreground or background.
Even though I have remote-notification background mode enabled ("Required background modes" has "App downloads content in response to push notifications" from the Info of the project setting), it won't wake up the app.
Am I missing something here?
Just to be clear, I don't want users to see the push notification permission alert because I don't need to show anything when push notification is received. I'm just trying to wake up the app and do some processing.
This is the payload I'm using.
{ "aps": { "content-available": 1 } }
From console, I see this.
apsd[82] <Warning>: Silent Push: Deny app has no feature.

Modal alert request for push notifications

debuggers,
I have created an app that embeds push notifications.
For one or other reason the user does not get asked for permission on the first load.
In the past I have used push notification and everything seemed to work, the code for is pretty much "copy-pasted".
I requested a certificate from a certificate authority (keychain)
I enabled push notification and downloaded a new certificate
Uploaded the certificate to apple and received a validated development and distribution certificate.
I downloaded a new development + production provisioning profile.
I signed the app with the provisioning profile.
When I open the provisioning profile in textedit I do see the following key:
aps-environment
I used this profile to sign the app and install it on to the device!
I have tried several methods like setting the time on my phone to days ahead, rebooting, re-installing.
I use urban airship as a push service!
Does anyone have any idea what is going wrong?
Do you have [UAPush setDefaultPushEnabledValue:NO] set by any chance?
By setting this value to NO UrbanAirship delay prompting users to enable push notifications until you are ready to ask. This gives you a chance to explain what they are used for instead of it popping up right when the app starts.
Then later you can enable them by calling
UIRemoteNotificationType notificationTypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];

UIAlertView outside app

On iOS which is the class name used to show UIAlertView outside the application, like the notification system does?
Thanks!
You'll need to use local notifications, or setup apple's Remote Push notification service.
Local Notifications
Push Notifications

Open app from url in Mobile safari fails with .zip extension

I have used the info in this great post How do I associate file types with an iPhone application? to get my app launching from Mail with both mydoc.foo and the compressed version mydoc.foo.zip which auto-magically decompresses into my apps sandbox.
I can open a url such as http://blah.com/shared/mydoc.foo into my app with Safari but when the url is http://blah.com/shared/mydoc.foo.zip I get the message Unable to open Document when I use the Open in MyApp button on the loaded page.
Im wondering what needs adding to my info.plist to get this particular URL working as Safari recognises my app as the receiver for this extension set and Mail behaves perfectly well.
Its not hitting the
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url delegate method.
Since you want to accept .zip files and the page you've linked accepts .gz files, make sure you've specified a com.pkware.zip-archive UTI instead of org.gnu.gnu-zip-archive.

observe osx application's state(opening, quitting)

how can I get notified at my app while the specify application is opening or closing?
for example, I need do something in my app when iTunes is quitting.
Subscribe to the NSWorkspace notifications NSWorkspaceDidLaunchApplicationNotification and NSWorkspaceDidTerminateApplicationNotification.