Sending requests when user answer "App wants to use location services" - objective-c

I'm using Core Location in my app, app asks user if he wants to use Location services, but I use in my app async requests, so app doesn't wait while user answer "Ok" or "dismiss". Ho can I prevent this? I want that my request will be send when user taps "OK". Thank you

In iOS 4.2 and up, your delegate will receive a message locationManager:didChangeAuthorizationStatus: when the authorization status changes (i.e. the user responds to the dialog, or the user backgrounds your app and goes into Settings and changes the global location settings). If you support earlier versions, you'll have to fall back to guessing based on locationManager:didUpdateToLocation:fromLocation: and locationManager:didFailWithError: messages (especially the NSError code kCLErrorDenied in the latter).

Related

Problem showing data from incoming webhook | Taiga --> Rocketchat

I'm trying to generate alerts based on notifications from Taiga project management software (when a user creates a project for example). These alerts will arrive to a specific Rocket.chat channel.
For this I am using the incoming Rocketchat webhooks: https://docs.rocket.chat/administrator-guides/integrations/
So I created the incoming webhook and entered the data into Taiga:
Configuring the webhook in Taiga
Once all this is done I check that the message arrives at the destination correctly:
Example of a notification message
Indeed, the message is received but it doesn't show any information. When a user history, an issue or any modification that leads to an alert is created, it is received in rocketchat but it doesn't show any information (empty message).
Payload sended by Taiga to Rocketchat
Does anyone know why he won't show me any information?
Thank you very much in advance
Greetings.
Do you really want to post notifications to a Rocket Chat channel, when a taiga user created a project in taiga? I would not know, how you can do that. But, as far as I can see, your screenshot shows the configuration of a generic webhook in a project after that project has been created. Therefore, I hope it is sufficient to post notifications from that project to your Rocket Chat channel. Here is my answer for this case:
I observed a similar behavior. Using the generic webhook, I could only trigger empty posts in my Rocket Chat channel by clicking on "test" for that webhook.
However, the Rocket Chat API seems to be compatible with the Slack API, cf. https://github.com/RocketChat/Rocket.Chat/issues/1728#issuecomment-166669379.
In contrast to the generic webhook, the Slack plugin for taiga (https://github.com/taigaio/taiga-contrib-slack) worked out of the box (https://tree.taiga.io/support/contrib-plugins/slack-integration/).
Only my browser gave me some hassle, because it cached the taiga webpage and after installing the Slack plugin a simple page reload was not enough to display the "Plugins" entry in the "Admin" menu of the project. "Shift+reload" did the job. But apart from that standard issue, everything worked.

EasyAPNS initially setting all flags to disabled

We're using EasyAPNS to help us with push notifications in our iPhone app, being sent from our PHP web app.
On first installation of the app, the user sees the request to allow us to send push notifications, even if they select allow, all the flags are sent to the web server from the iPhone as 'disabled'.
If you terminate the app, and reopen it, when it sends the settings again... they are sent as the correct options (e.g., enabled)
We followed the steps exactly, with one small difference, that we are using
application:didfinishlaunchingwithoptions:
instead of
applicationDidFinishLaunching
As it's apparenly deprecated according to this
Can anybody shed some light on this, and point us in the right direction for a fix?
So if the user rejects push messaging, you will re-ask when the app is next used after termination? It may get a little annoying for the user to be asked the same question over and over again.
And you will have to ask for permission or else that user wouldn't be registered for Push.
Have a look at http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html

How to use FB Javascript SDK Event Subscribe

I've recently implemented FB Javascript SDK for a mobile web app and am playing with their event subscription code:
FB.Event.subscribe('auth.statusChange', handleStatusChange);
I notice that handleStatusChange is called when I log in into facebook through my app. However, if I open another browser tab, go to facebook.com and log out the function isn't called.
I was expecting it to be called. Am I wrong? I thought the point of this function was to monitor changes that were not necessarily within the purview of my app.
Thanks!
auth.authResponseChange - fired when the authResponse changes
https://developers.facebook.com/docs/reference/javascript/FB.getAuthResponse/
This would be when a users add or removes a permission, in our flows we are supposed to provide away for a users to remove each permission and authResponse allows us to monitor.

Sending commands to iPhone app through Apple Push Notification Service

I am working on an iPhone application and I was wondering if I can send a command from my server to activate my application, at which point my app would contact the server with my payload.
You could send a notification to your app saying there are changes.
If the user decides to start of the app as a result of the notification, you could then check for the payload.
You can't automatically start the app with APS though.

On a Mac how to determine a user logout is occuring

I am very new to the Mac platform and Objective-C in general and in my application I would like to know how to determine that a user is logging out and perform some actions prior to this. Any info or pointers for this?
The official way to put the hook at logging in / logging out is described in these Apple documents Customizing Login and Logout and Tech Note 2228. But I'm afraid that the log-out hook was no longer directly supported.
So, the second best way is to run a headless Cocoa app, and receive a notification from the system using NSWorkspace, see the document and the list of available notifications.
To make a headless Cocoa app, you need to set an entry in its Info.plist called LSUIElement, see here. By setting LSUIElement to be yes, the app don't appear in the dock, but perform various operation in the background.
Take a look at Receiving Workspace Notifications in this Workspace Services document.
NSWorkspaceWillPowerOffNotification
Posted when the user has requested a
logout or that the machine be powered
off.