Custom URL to launch Facebook Messenger on iOS - ios

How can I launch FaceBook Messenger (if installed) with a compose Windows to a specific FB ID.
If messenger is not installed, can we launch FaceBook app and have the compose Windows open to a specific FB ID.
In the rare instance if no Facebook apps are installed, can we launch mobile Safari with the compose window?

The URL scheme is fb-messenger://user-thread/{user-id}. I just build my app with fb-messenger URL scheme as Viewer and trapped the URL on the UIApplication delegate. The user-id parameter is long integer one, as in https://developers.facebook.com/docs/graph-api/reference/user/

Just use https://m.me/USER_ID.
This will deep link the user to the native Messenger app if available and start a conversation with the user identified by its USER_ID.
If the native app is not available on the device, it will open the messenger web app in a new browser.

You can only launch an installed app using the Custom -URL. But you cannot check whether the app is installed or not (Second part of your question.) Reason: If it would have been possible to check the installed apps in iOS, One can then create app which will get information of all installed apps.
facebook Custom URL latest updates:
fb://album/%#
fb://album/(aid)
fb://album/(aid)/cover
fb://album/(initWithAID:)
fb://album/(initWithAID:)/cover
fb://album/new
fb://albums
fb://birthdays
fb://birthdays/(initWithMonth:)/(year:)
fb://birthdays/(month)/(year)
fb://chat/(fbid)
fb://chat/(initWithUID:)
fb://chat/(user.fbid)
fb://contactimporter
fb://contactimporter/invites
fb://contactimporter/legalese
fb://contactimporter/modal
fb://event/%#
fb://event/%llu
fb://event/(event.fbid)/members/(rsvpStatus)
fb://event/(fbid)
fb://event/(fbid)/members/attending
fb://event/(fbid)/members/declined
fb://event/(fbid)/members/not_replied
fb://event/(fbid)/members/unsure
fb://event/(fbid)/rsvp
fb://event/(initWithEventId:)
fb://event/(initWithEventId:)/members/(rsvpStatus:)
fb://event/(initWithEventId:)/rsvp
fb://events
fb://events/
fb://faceweb/(initWithURL:)
fb://facewebmodal/(initWithURL:)
fb://feed
fb://feed/%#
fb://feed/(filter.filterKey)
fb://feed/(initWithFilterKey:)
fb://feedfilters
fb://findfriends
fb://findfriends/legalese
fb://findfriends/modal
fb://friends
fb://friends/picker
fb://friends/sync
fb://friends/sync/(removeData:)
fb://friends/sync/disconnect
fb://friends/sync/legalese
fb://group/(fbid)/members
fb://group/(initWithGroupId:)/members
fb://groups
fb://launcher
fb://mailbox
fb://mailbox/(folder)
fb://mailbox/(initWithFolder:)
fb://mailbox/(initWithFolder:)/(tid:)
fb://mailbox/(mailbox.folder)/(tid)
fb://mailbox/compose
fb://mailbox/compose/(fbid)
fb://mailbox/compose/(initWithUID:)
fb://map
fb://messaging
fb://messaging/(folder)
fb://messaging/(initWithFolder:)
fb://messaging/(initWithFolder:)/(tid:)/participants
fb://messaging/(initWithFolder:)/thread?tid=(tid:)
fb://messaging/(mailbox.folder)/(urlEscapedTid)/participants
fb://messaging/(mailbox.folder)/thread?tid=(urlEscapedTid)
fb://messaging/compose
fb://messaging/compose/(fbid)
fb://messaging/compose/(initWithUID:)
fb://messaging/original_message?mid=(commentId)
fb://messaging/original_message?mid=(initWithMessageId:)
fb://nearby
fb://note/%#
fb://note/(initWithNoteId:)
fb://note/(initWithNoteId:)/edit
fb://note/(noteId)
fb://note/(noteId)/edit
fb://note/compose
fb://notes
fb://notifications
fb://online
fb://online#offline
fb://online#online
fb://page/(page.id)
fb://pages
fb://photo/%#/0/%#
fb://photo/(album.user.fbid)/(album.aid)/(pid)
fb://photo/(album.user.fbid)/(album.aid)/(pid)/feedback
fb://photo/(fbid)/profilepic
fb://photo/(initWithProfilePicturesUID:)/profilepic
fb://photo/(initWithUID:)/(aid:)/(pid:)
fb://photo/(initWithUID:)/(aid:)/(pid:)/feedback
fb://photosapp
fb://place/%#
fb://place/(initWithPageId:)
fb://place/(targetId)
fb://place/addfriends
fb://place/addphoto
fb://place/create
fb://places
fb://places/%lld/%lld
fb://places/(initWithCheckinAtPlace:)/(byUser:)
fb://places/legalese/tagged/%lld/%lld
fb://places/legalese/tagged/(initWithTaggedAtPlace:)/(byUser:)
fb://post/%#
fb://post/%#_%#
fb://post/(initWithPostId:)
fb://post/(initWithPostId:)/tagged
fb://post/(postId)
fb://post/(postId)/tagged
fb://post/(postId)/untagSelf
fb://post/(untagSelfFromPostWithId:)/untagSelf
fb://profile
fb://profile/
fb://profile/%#
fb://profile/%lld
fb://profile/(addFan:)/addfan
fb://profile/(fbid)
fb://profile/(fbid)/addfan
fb://profile/(fbid)/addfriend
fb://profile/(fbid)/fanpages
fb://profile/(fbid)/fans
fb://profile/(fbid)/favorite
fb://profile/(fbid)/friends
fb://profile/(fbid)/info
fb://profile/(fbid)/menu
fb://profile/(fbid)/mutualfriends
fb://profile/(fbid)/photos
fb://profile/(fbid)/poke
fb://profile/(fbid)/removefriend
fb://profile/(fbid)/wall
fb://profile/(initWithFBID:)/menu
fb://profile/(initWithFansUID:)/fans
fb://profile/(initWithFriendsUID:)/friends
fb://profile/(initWithInfoUID:)/info
fb://profile/(initWithMutualFriendsUID:)/mutualfriends
fb://profile/(initWithPhotosUID:)/photos
fb://profile/(initWithUID:)
fb://profile/(initWithUID:)/addfriend
fb://profile/(initWithUID:)/fanpages
fb://profile/(initWithUID:)/poke
fb://profile/(initWithUID:)/removefriend
fb://profile/(initWithWallUID:)/wall
fb://profile/(toggleFavorite:)/favorite
fb://profile/(user.fbid)/fans
fb://profile/(user.fbid)/friends
fb://profile/(user.fbid)/mutualfriends
fb://profile/0
fb://publish
fb://publish/mailbox/(initWithFolder:)/(tid:)
fb://publish/mailbox/(mailbox.folder)/(tid)
fb://publish/photo/(album.user.fbid)/(album.aid)/(pid)
fb://publish/photo/(initWithUID:)/(aid:)/(pid:)
fb://publish/post/(initWithPostId:)
fb://publish/post/(postId)
fb://publish/profile/(fbid)
fb://publish/profile/(initWithUID:)
fb://publish/profile/(owner.fbid)
fb://requests
fb://root
fb://upload
fb://upload/%#/album/%lld/%#
fb://upload/%#/checkin/%lld
fb://upload/%#/profile/%lld
fb://upload/(initWithSource:)/album/(uid:)/(aid:)
fb://upload/(initWithSource:)/checkin/(checkinId:)
fb://upload/(initWithSource:)/profile/(uid:)
fb://upload/actions
fb://upload/actions/album/(initWithUID:)/(aid:)
fb://upload/actions/album/(user.fbid)/(aid)
fb://upload/actions/checkin/(checkinId)/
fb://upload/actions/checkin/(initWithCheckinId:)
fb://upload/actions/newalbum
fb://upload/actions/profile/(fbid)
fb://upload/actions/profile/(initWithUID:)
fb://upload/actions/resume
fb://upload/album/(showUploadMenuWithUID:)/(aid:)
fb://upload/album/(user.fbid)/(aid)
fb://upload/checkin/(checkinId)
fb://upload/checkin/(showUploadMenuWithCheckinID:)
fb://upload/discard
fb://upload/profile/(fbid)
fb://upload/profile/(owner.fbid)
fb://upload/profile/(showUploadMenuWithUID:)
fb://upload/resume
fb://userset
fb://video/%#
fb://video/(playVideoWithId:)
fb://video/(videoId)

sample ,It's work for me in ios
let msgUrl = URL(string: "http://m.me/{PAGE_NAME}")
UIApplication.shared.openURL(msgUrl)
reference in document of dev facebook : https://developers.facebook.com/docs/messenger-platform/discovery/m-me-links/

Related

Nativescript with Googlemap static api - issue on iOS

I am trying to add an image of a map generated by the google map static api in my Nativescript application (I'm using Nativescript with Vue).
I am able to make it work on Android but I have some issues on iOS.
I simply have an Image component like that <Image :src="map_source" />
And in my vue data, I have map_source: "https://maps.googleapis.com/maps/api/staticmap?&markers=48.2,2.1&path=color:red|weight:5|fillcolor:red|48.2,2.1|48.3,2.13|48.4,2.12&zoom=10&size=460x200&key=MY_API_KEY"
When I use this URL in my browser, I get the desired map.
When I use this URL in my app on Android, it displays the map correctly.
But when I use the same URL in my app on an iOS device, the map is not displayed at all.
Note: if I remove the path (e.g map_source: "https://maps.googleapis.com/maps/api/staticmap?&markers=48.2,2.1&zoom=10&size=460x200&key=MY_API_KEY", the image is correctly displayed on both Android and iOS. The error only appens when I add the path.
Is this an iOS issue or am I doing something wrong ?
I was able to find the issue thanks to #Manoj. On iOS devices, the URL was unsupported because of the "|" character. So I had to encode it like so:
let imageSourceModule = require("tns-core-modules/image-source");
let url = encodeURI("https://maps.googleapis.com/maps/api/staticmap?&markers=48.2,2.1&zoom=10&size=460x200&key=MY_API_KEY")
imageSourceModule.fromUrl(url).then(res => {
this.map_source = res;
});

How can iOS 3D touch on app be automated?

I write Appium UI tests for my iOS app. Some of the tests have such workflow:
an app is sent to background
the user does "force touch" on the app's icon, until menu (shortcuts) appear
an app is launched from this shortcut
My environment:
Simulator iOS 13.2
appium 1.15.0
Appium Python Client 0.47
I've tried such code (Python), it doesn't do "force touch":
self.driver.background_app(-1) # this works: sends an app to backround
args = {'duration': 5, 'x': 200, 'y': 200}
self.driver.execute_script("mobile:touchAndHold", args) # this doesn't work: force touch on Home screen
(I've tried to adjust coords, e.g. (150,200), (260,400) - no app icon was pressed).
I've tried AppleScript, but all I can do now is to activate Simulator app. :)
What I've found but it's not working:
https://saucelabs.com/blog/how-to-automate-3d-force-touch-with-appium: in this post "press" command was used with "element" = AppName, but my selenium driver says "press" requires "x", "y", not "element"
https://developers.perfectomobile.com/display/TT/Using+iOS+3D+Touch: in this post, driver.executeScript("mobile:touch:tap", parms) is used, but my driver says there's no command "mobile:touch:tap":
selenium.common.exceptions.WebDriverException: Message: Unknown mobile command 'touch:tap'. Only scroll, swipe, pinch, doubleTap, twoFingerTap, touchAndHold, tap, dragFromToForDuration, selectPickerWheelValue, alert, setPasteboard, getPasteboard, source, getContexts, installApp, isAppInstalled, removeApp, launchApp, terminateApp, queryAppState, activateApp, viewportScreenshot, startPerfRecord, stopPerfRecord, installCertificate, startLogsBroadcast, stopLogsBroadcast, batteryInfo, deviceInfo, activeAppInfo, pressButton, enrollBiometric, sendBiometricMatch, isBiometricEnrolled, clearKeychains, getPermission, siriCommand commands are supported.
I've looked at XCUITestDriver documentation/code, e.g. https://github.com/appium/appium-xcuitest-driver/blob/master/lib/commands/execute.js, and can't see any 3D-touch related stuff.
So do you know:
1. how to automate 3D-touch on app icon in iOS Simulator?
2. How to check if it's supported by XCUITest-Driver?
3. Can it be automated by smth like AppleScript?
Thanks in advance :)
If you mean like https://i.stack.imgur.com/3Fo7v.png, you can open it like below.
(Ruby code)
# Long press 'Contacts' icon with W3C actions
el = #driver.find_element :name, 'Contacts'
action_builder = #driver.action
action_builder.move_to(el)
.pointer_down(:left)
.pause(action_builder.pointer_inputs[0], 2)
.pointer_up(:left).perform
https://appium.io/docs/en/commands/interactions/actions/ is the API.
You can find Python, too.
(iOS 13 does not provide '3D touch'. The feature has been long-press style)

Messenger not appearing in Share Sheet (UIActivityViewController) of branch.io

I am trying to share something via the branch.io share sheet:
let shareText = "Some Share Text"
let linkProperties = BranchLinkProperties()
linkProperties.feature = "Some"
linkProperties.addControlParam("$desktop_url", withValue: desktopURLString)
linkProperties.addControlParam("$android_url", withValue: androidURLString)
let object = BranchUniversalObject(canonicalIdentifier: "some.cannonical.identifier")
object.title = "Some Title"
object.imageUrl = someImageURL
object.contentDescription = "Some Content Description"
object.addMetadataKey("some_id", value: identifier)
object.showShareSheet(with: linkProperties,
andShareText: shareText,
from: self,
completion: completion)
All works great, except that the Facebook Messenger app does not show as option in the share sheet. Neither in the suggested options nor under 'More'. What is needed to achieve that?
I found the following question / answer for the default UIActivityViewController. How does that work with branch.io though? Facebook Messenger not showing up with UIActivityViewController
When you share via a share sheet on iOS - whether you use the Branch share sheet or UIActivityViewController - the choice of sharing options is not yours to define, it is defined by the user.
The interface for setting which apps will appear on the list can be accessed by opening a Share Sheet and then scrolling through the list of presented apps until you see the "..." (More) option. Tap on this button and you will be presented with the list of apps that can be shared to on the phone:
Each app will have a slider - if the slider is enabled for a particular app, that app will appear in the list.
Enabling Facebook Messenger for sharing on a user's phone is not something you can do from within your app as a developer.
You mention that the Messenger app is not even available when you tap the More button. This strikes me as odd; every device I check does have Facebook Messenger as an option if it is installed. Perhaps try removing and reinstalling Facebook Messenger.
I dived into the issue once more and I finally found the trouble maker. If I set feature of the branch link properties to a string value containing a space, Messenger disappears in the share sheet. The example:
let properties = BranchLinkProperties()
properties.feature = "Share News" //does not work, messenger does not appear in the share sheet
//properties.feature = "Share_News" //works, messenger appears in share sheet
object.showShareSheet(with: properties, andShareText: "Some Share Text", from: viewController, anchor: UIBarButtonItem()) { (activityType, completed) in
if (completed) {
print(String(format: "Branch TestBed: Completed sharing to %#", activityType!))
} else {
print("Branch TestBed: Link Sharing Cancelled\n")
}
}
feature is used as a parameter in the URL in Branch which is then given to the sharing extension. While this, I think, is an encoding issue in Branch, it seems that the Messenger sharing extension is not handling the URL in the same way as other apps. The 'broken url' does work with other sharing extensions. Hope this helps someone else! I will change the name of my feature to something without space for now.

App crash with distriqt scanner ane on Android

I use the distriqt scanner ane and it works very vell on iOS. But with the similar app on Android it crashes the app immediately (while calling Scanner.service.startScan( options ))
I got follwing from logcat:
E/QCOM PowerHAL( 313): Invalid hint ID.
E/mm-camera-intf( 313): mm_camera_open: opened, break out while loop
E/InputDispatcher( 858): channel '2da9ab5b air.myfunnyappidcovered/air.myfunnyappidcovered.AppEntry (server)' ~ Channel is unrecoverably broken and will be disposed!
E/InputDispatcher( 858): channel 'e01d279 air.myfunnyappidcovered/com.distriqt.extension.scanner.zbar.ZBarScannerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
Any Idea? All permissions and permission-freatures are set. The AS-Code works, like the iOS-compile shows. Tested with the same result on different Android-devices.

Blackberry facebook integration error

I have integrated the facebook in my app using http://sourceforge.net/projects/facebook-bb-sdk, it work fine in stimulator but when view in device it show me the
http://m.facebook.com/login.php?app_id=0000000000[0.0] 61&cancel=http%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html%3Ferror_reason%3Duser_denied%[0.0] 26error%3Daccess_denied%26error_description%3DThe%2Buse[0.0] r%2Bdenied%2Byour%2Brequest.&fbconnect=1&next=https%3A%2F%2Fm.facebook.com%2Fdialog%2Fpermissions.re[0.0] quest%3F_path%3Dpermissions.request%26app_id%3D175269295861061%26redirect_uri%3Dhttp%253A%252F%252Fw[0.0] ww.facebook.com%252Fconnect%252Flogin_success.html%26di[0.0] splay%3Dwap%26response_type%3Dtoken%26fbconnect%3D1%26perms%3Duser_about_me%252Cuser_activities%252C[0.0] user_birthday%252Cuser_education_history%252Cuser_events%252Cuser_groups%252Cuser_hometown%252Cuser_[0.0] interests%252Cuser_likes%252Cuser_location%252Cuser_not[0.0] es%252Cuser_online_presence%252Cuser_photo_video_tags%252Cuser_photos%252Cuser_relationships%252Cuse[0.0] r_relationship_details%252Cuser_religion_politics%252Cuser_status%252Cuser_videos%252Cuser_website%2[0.0] 52Cuser_work_history%252Cemail%252Cread_friendlists%252[0.0] Cread_insights%252Cread_mailbox%252Cread_requests%252Cread_stream%252Cxmpp_login%252Cads_management%[0.0] 252Cuser_checkins%252Cfriends_about_me%252Cfriends_activities%252Cfriends_birthday%252Cfriends_educa[0.0] tion_history%252Cfriends_events%252Cfriends_groups%252C[0.0] friends_hometown%252Cfriends_interests%252Cfriends_likes%252Cfriends_location%252Cfriends_notes%252C[0.0] friends_online_presence%252Cfriends_photo_video_tags%252Cfriends_photos%252Cfriends_relationships%25[0.0] 2Cfriends_relationship_details%252Cfriends_religion_pol[0.0] itics%252Cfriends_status%252Cfriends_videos%252Cfriends_website%252Cfriends_work_history%252Cmanage_[0.0] friendlists%252Cfriends_checkins%252Cpublish_stream%252Ccreate_event%252Crsvp_event%252Coffline_acce[0.0] ss%252Cpublish_checkins%252Cmanage_pages%252Coffline_ac[0.0] cess%26from_login%3D1&rcount=1&_rdr
I have change the app id in url.
just show me the text in white background.Please let me know if anything else requires.
Thank you
It was issue from network side,i have check with other wi-fi and it was working.
Thank you.

Resources