User’s activity history in iPhone - iphone

I want to make an app, wherein I have access to the following
Logs: call log, message log, app usage log, media log, ...
Logging data per activity: ex) call log: call direction, phone number, call
duration, location, ...
Privacy policy (logging policy, using policy of the log data, user
consent policy, ...)
Are there any APIs available to achieve above mentioned.

There are no public available API's that will allow you to access this information.

Related

Keycloak SPI: How to display custom error messages in the Admin console

I've implemented a Keycloak Storage Provider plugin that communicates with a remote user store. When an error occurs, I want that to be shown in the Admin UI. For example, in the Admin UI under Users you can display a list of users. You can then show/edit a given user's attributes by clicking on the user's ID link. When an error occurs, I throw an Exception. However this just shows up as an unknown server error. Is there any way to get the Admin UI to show the message in the exception or some other way to get the UI to display the error like a Status.setError() API I may have missed?
Try to use org.keycloak.models.ModelException(String message, Object ... parameters). I use it when i attempt to update password of user in external user storage. First param is a name of message key (see messages_??.properties localozation files in /theme folder of keycloak distribution), second param is a bunch of values that should be used for message templating.
org.keycloak.storage.ReadOnlyException is also shown well in UI.

/me/events - Events API

So, I've read conflicting information about this bit. But we've received complaints that users are unable to import their events in our application, although we have an approved App that has the "user_events" permission.
In short, the response when querying me/events using a user access token of the mentioned app is empty:
Edge: me/events
{
"data": []
}
Now, the funny part is, if you are a developer of the application in question, the endpoint will happily send you your own events over the API.
Is this intended behavior according to https://developers.facebook.com/docs/graph-api/reference/user/events/?
This edge is only available to a limited number of approved apps. Unapproved apps querying this edge will receive an empty data set in response. You cannot request access to this edge at this time.
Was there any communication about this? We have updated our application after they restricted the public access in May to use the user_events permission, but it looks like this access is now disabled as well, and even in a very sneaky way that makes it very hard to detect? Also, I did not read anything about this in any breaking change logs?
I'm just searching for clarification, because there is no way to properly contact Facebook regarding this issue.

Google Analytics API Response - "User does not have sufficient permissions for this advanced segment" but they do

Using the GA API with a particular segment, the authenticated token is from an admin who created the segment. The segment was shared with the permissions for "Collaborators and I can apply/edit Segment in this View"
I've verified the Property ID, View ID, and Segment ID from the interface with the API call. The GA API returns "User does not have sufficient permissions for this advanced segment."
The user created the segment and shared it, so I'm at a bit of a loss as to why I get this error response. Any help would be much appreciated. Thanks!
#Ash has the correct answer but here is a more detailed response:
The user that created the Segment must open complete the following in Google Analytics:
Open the segment panel and select 'Custom', then click 'Edit' for the segment you would like to share.
Then click 'Change' in the top right corner.
You can now select the option allowing collaborators to apply and edit the segment within the view.
Save your changes.
This will allow you to query the custom segment using a service API.
1) A segment in Google Analytics belongs to the user who created it and only that user has access to the segment.
2) A service account will not have access to any of the saved advanced segments. For API requests you could try using dynamic segments instead.
So, a User has saved segments and those segments can be applied to any request for views (profiles) that the User has access to.
Example:
Assuming User A creates/saves a segment and User B also has saved segments and your application is authorized to access User A and B's Analytics account (i.e. they give permission to your App to access their data). The App would be able to retrieve the IDs of the saved segments for both users but you can't apply User A's segment ID to a request for User B's data. For that to work, User A would need to have access to User B's view (profile) to begin with.
I was facing same issue and the error was:
HttpError 403 when requesting https://analyticsreporting.googleapis.com/v4/reports:batchGet?alt=json returned
"User does not have sufficient permissions for this advanced segment."
Creating shared Segment resolved above issue.
Credits and more info: Google groups

Pass anonymous PFUser to Cloud Code in Parse iOS SDK

I'm trying to secure a Cloud function in my Parse app. This function doesn't create objects or anything. It just calls an external API and returns the result. However, to make it secure I'm trying to create an anonymous user using the iOS SDK like so:
PFUser.enableAutomaticUser()
print(PFUser.currentUser())
which outputs
Optional(<PFUser: 0x7fd3535570c0, objectId: new, localId: (null)> {})
So seems like the user is being created. But when I make a request using the PFCloud object, my parse function in Cloud gets a null user:
PFCloud.callFunctionInBackground("<endpoint>", withParameters:[<params_dict>], block: {(result) -> Void in
print(result)
})
Result on console log says "user":null. Does anyone know what I could be missing? Also, is this the best way to ensure requests are coming from my iOS client only, and not from some other source?
Thanks.
Your anonymous user is null because unless you save that user or an object related to it, it will not exist on the server. From Parse documentation:
Anonymous users can also be automatically created for you without
requiring a network request, so that you can begin working with your
user immediately when your application starts. When you enable
automatic anonymous user creation at application startup, [PFUser
currentUser] will never be nil. The user will automatically be created
in the cloud the first time the user or any object with a relation to
the user is saved. Until that point, the user's object ID will be nil.
Also you cannot simply check if a request is coming from an iOS client. The whole point of a REST system is that server does not keep any state, it just responds to the requests from different sources. The sources have to send in their credentials (usually in a from of a security token which is issued by the server during a login) with every request. Server verifies the token is genuine and has not been tampered with before serving the request. Parse provides you with user authentication which makes it easy for you to verify that a logged in user is requesting something. You can then build extra security measures on top of that to make sure only certain users are allowed to access certain data.

Core Location opt-in protocol

Is there any documentation the defines the protocol followed by iPhone OS to obtain the Core Location opt-in from the user?
I've observed that the user is shown a dialog the first two times an application is run. The dialog asks the user if it's OK for that particular application to use location information. Once the user has approved the application the second time the framework treats that as a permanent opt-in.
Is this behavior officially documented anywhere?
I assume you've seen the description in the CLLocationManager class reference documentation? It's not too specific on the details though...
Important: The user has the option of
denying an application’s access to the
location service data. During its
initial uses by an application, the
Core Location framework prompts the
user to confirm that using the
location service is acceptable. If the
user denies the request, the
CLLocationManager object reports an
appropriate error to its delegate
during future requests.