I have a direct chat messaging app where when a user pastes and submits a share link via apple maps of a specific location, it displays as a long ugly link. The redirect and it being clickable is all good and okay, but optically, it'd be nice to abbreviate it like iMessage does for apple maps links to maps.apple.com.
Is there any way to detect and convert the link into one that is easier to consume? I could not find any references or threads to even begin experimenting with solutions, so any thoughts would be greatly appreciated.
You can use Apple's CLGeocoder to convert coordinates and create a "link preview" feature inside your app. Here are some useful links:
https://developer.apple.com/documentation/corelocation/clgeocoder
https://developer.apple.com/library/archive/technotes/tn2444/_index.html
Related
TL/DR
How can I make an iOS app appear on share sheet to receive shared urls from any other app?
This is a super newbie post as I have never really touched swift to develop anything, but I couldnt find the answer to my question on google so i wanted to start here. Almost everything I found by googling around is UIActivityViewController which appears more to be about how to share content from my app to another app; while what I am trying to do is share urls from another app to my app.
I am try to build a simple app for ios (doesnt have to be old version compatible because it will be only used by me) that can be a receiver for shared urls from apps like safari, brave or youtube. All the app does is when user clicks on the share button, and then chooses the app, the app gets the relevant data that is being passed, and then posts it to a backend server.
I can accomplish this on my android app/devices with an intent filter action android.intent.action.SEND in the manifest, and then listening for it with Intent intent = getIntent() in my method.
Would someone be kind enough to point me in the right direction at what I should look into (google about). If you can also point me to some sample code examples on how to write an app that can be the receiver for shared data (like urls), that would be fantastic. I am not sure what to search for so that my app can show up on share sheet, and how to then react with the data.
Again, apologies for the super noob question, but I couldnt translate my idea to something relevant on google.
It can be achieved by an Action Extension. Search for it.
Here is one:
https://code.tutsplus.com/tutorials/ios-8-how-to-build-a-simple-action-extension--cms-22794
I think both Share extension and Action extension can do the job. It depends on your needs.
Check this table to make sure which one is more appropriate for your purpose.
You can refer to App Extension Programming Guide by Apple.
I am building an application that must take user's input of a start location, and two destinations and show the route between the three. I have used google maps api in my project to add a map view, but the google directions API is not meant for user input. Should I use the google maps javascript API or add a web view. How would I go about using either?
Google Maps Javascript API: https://developers.google.com/maps/documentation/javascript/directions#Directions
What about the option of having the user launch either google maps or maps with the direction? To do that there's a pretty good answer here: How to Open Google Map Navigation Url with Direction and Voice in iOS?
Multitasking on the phone is pretty good these days so it shouldn't cause too much user annoyance to have another app (built to directions) take over that job. The only reason I'd see to not do it that way is if your app is something like Uber, but if that's the case then there's a few other things you could do.
Hey Guys I was wondering if there is a way to redirect the user back to my iOS app after they've reached their destination on Apple maps or Google maps. Thanks!
This could be possible if the app you open, is yours as well, then you could add some code there that does that. However, if you are talking about google maps / Apple maps, then that is not the case.
As far as I know, there is no api for that... iOS 9 brought the "back to..." button exactly for these situations which gives the user an easier way of switching back to the opening app.
Question, why to open another app if maps is all you need? You can always implement a map in your app and save the switching...
I want to add a share button inside an iOS app and wonder if it is possible to get any statistics of how many people have used the shared button inside my app? When people use the share function they will share an image from their phone and not any URL. I wonder if facebook already have any built in function for this or if I need to track the clicks programmatically.
Thanks in advance!
Vatan
Google will allow you to do tracked links for Android, so there must be an equivalent for IOS. https://developers.google.com/analytics/devguides/collection/android/v2/campaigns#google-play-url-builder
There is a way to add trackable links and analytics using SWIFT, according to Google. https://developers.google.com/analytics/devguides/collection/ios/v3/
Look into App Events. You can define your own events for actions users take in your app, and then you can evaluate them in Facebook Analytics for Apps.
https://developers.facebook.com/docs/app-events
https://developers.facebook.com/docs/analytics
It is possible to launch another app (such as youtube, AppStore,Map, etc) from my iOS app & give it keyword for searching?
For example, I would like provide to user ability search cartoon video from my app & show the results in Youtube app.
Please share your though/
Thanks,
Huy
The only way to communicate with other apps is through URLs. Have a look at communicating with other apps. To answer your question, just create a URL that contains the search terms.
Since tagged app-store in your question, I'm sure you find this useful: How to link to apps on the app store.
A tip is to use itms:// instead of http://, then it'll open in the app
store directl