foursquare: getting location/checkin out of a badge - api

I have a list of badge messages exported by users through twitter:
i.e. https://foursquare.com/ruben_es/badge/4f07d1fee4b026656d9dad16?ref=tw
I can't seam to understand if it's possible to access the checkin/venue connected with this badge. The web page for the badge doesn't report anything and also the API doesn't mention anything as far as I can tell.
https://developer.foursquare.com/docs/responses/badge has a field "unlocks that says:
"Optional If present, an array of unlock data. Array contains checkins, which is an array of checkins. Currently both arrays will only contain 1 element.". What are these unlock checkins?
Any ideas?

When accessing the badges for the acting user or the acting user's friends, the unlocks array will contain a single checkin object. That check-in is the one that caused the user to unlock the badge.
So if you're looking for the location where that badge was unlocked, look at the venue object contained in the unlock check-in.

Related

Access deep link information from Reminders API?

iOS 9 introduces a new reminders feature which allows you to deep link back to any app (including 3rd party apps which implement the NSUserActivity API).
For example, if you launch Messages, tap a conversation, hold the home button, and say, "Remind me about this in 5 minutes," you will get a reminder with a Messages icon. Tapping on the Messages icon from within Reminders later on will take you directly to that conversation.
If I use the EKReminder API, I can get this reminder, but can I get any of this other information?
In other words, is there any way to:
Know that this reminder has special metadata associated with it?
Get the deep link associated with it?
Get the icon of the app that will handle the deep link (just like the Reminders app does)?
From Apple's iOS 9 page:
"Remind me about this when I get in the car."
Siri can remind you about things you’re looking at in your apps — like Safari, Mail, and Notes — and want to follow up on later. If you’re halfway through an email, you can say “Remind me about this tonight.” Or if you’re looking at a place in Maps you want to stop at later, you can ask for a reminder when you get to your car.

How to set message caption using Facebook Messenger SDK for iOS

I need to set a caption when I share a picture (QR code) from my app integrated with Facebook Messenger.
There is metadata NSString field but I don't see a way how to use it. Did anyone solve that problem?
metadata field You can see that we're passing options to the share
method. This contains two fields we want to send back to Messenger:
metadata and contextOverride.
The metadata field takes a NSString and is optional. It can be used to
give information about the content being shared. For example, you can
store a serialized JSON string. This is useful during replies as this
data is passed back to your app.
https://developers.facebook.com/docs/messenger/ios#bp_using_metadata
The metadata is meant for you, as a developer, to use. For example, when a user creates an image from your app you can attach metadata to it, at that point. This metadata is sent, in the background, together with the image to the recipient. When they decide to reply, using your app, you will receive the metadata there.
You can use this, for example, if in your app somebody selected a category to get the image. When you pass in this category in the metadata (which is up to you to format, but JSON is convenient), you get this metadata/JOSN in your app when the recipient replies. You can read the category and load the images on that category already.
The metadata does not set a caption to your image. Actually, there is no integrated way to add a caption to your images.
I would advise to generate the QR-code part of the image and the caption in your app. The image that you post to the Messenger API is thus a combination of the QR-code and a textual caption above or below it. Does that make sense?
ps: about the credible source; I'm a developer support engineer at Facebook :)

Is there a way to override the default sound for a remote notification?

I know you can do it with local notifications using the soundName property but that doesn't affect remote notifications. I understand that the normal way to do this is to include the sound reference in the payload, but I do not want to do that every time since I only plan to use one custom sound. There has got to be a simple way to do this.
Yes you can override default sound of remote notification. For that you need to change sound property in payload of aps dictionary. You need to set your desired sound file name and include that sound file in your project bundle.
More information regarding payload of aps, please check below image.
In Apple push notification programming guide, they mentioned as below.
Each push notification includes a payload. The payload contains information about how the system should alert the user as well as any custom data you provide. The maximum size allowed for a notification payload is 256 bytes; Apple Push Notification Service refuses any notification that exceeds this limit.
For each notification, compose a JSON dictionary object (as defined by RFC 4627). This dictionary must contain another dictionary identified by the key aps. The aps dictionary contains one or more properties that specify the following actions:
1. An alert message to display to the user
2. A number to badge the application icon with
3. A sound to play

How to save the user's email recipients when sending email with UIActivityViewController?

I'm using UIActivityViewController and when the user selects email from the list of options is there a way to save the email recipients that the user inputs?
Do I need to subclass ActivityItemSource as was done here?
I realize getting the email recipients is tricky even with just using MFMailcomposeViewController as in here.
Do I need to subclass MFMailcomposeViewController to save the email recipients that the user inputs?
From the class reference:
Important: The mail composition interface itself is not customizable
and must not be modified by your application. In addition, after
presenting the interface, your application is not allowed to make
further changes to the email content. The user may still edit the
content using the interface, but programmatic changes are ignored.
Thus, you must set the values of content fields before presenting the
interface.
So, no. You should not subclass MFMailcomposeViewController in order to "steal" the email addresses that the user has entered. This is a privacy issue, and Apple specifically designed it this way. If you try to circumvent this, then your app very likely will be (and should be) rejected.

Bing Maps in Windows 8 app

My question is similar to this one "https://bitly.com/UaQOC4", but that question is somewhat misleading.
In my Windows 8 Store app, I have a Bing map reference to a particular location somewhere in South Africa. The referenced location will have multiple pins to denote key areas of interest to users of the application, with an info window for each of the pins.
When a user clicks on a pin, the info window will give them more information, like statistics around the location and a link to a page within the application, for example: /pages/nests/crowsnest.html.
What I need is to be able to push the user, when clicked on the location in the info window, to this page, however, this does not seem to be allowed.
From my understanding, we're trying to force a page load from within the current domain space (our application) from outside of the application scope (info window == iframe) as this is not a web page, this seems to be disallowed.
Is my assumption correct in that we're trying to break the domain policy here? I don't see how we can, as we're just redirecting users to a page.
I have tried the WinJS.Navigation.navigate("/pages/nests/crowsnets.html") and event a normal -tag but neither of these approaches allowed me any success.
I'm still not sure what are you trying to achieve. You can use Bing Maps control in your Windows 8 app and you can pin any Pushpins in there, You can also handle the behavior when user taps any pin and show more detailed info on the map.
Bing Maps SDK for Windows Store apps