Cannot get back to my app after posting to facebook/twitter - facebook

I have developers working on the backend of my app using phonegap and once the user clicks facebook/twitter share a browser pops up and you can log in and share but after
that you cannot escape back to the app, if you get out of the apps altogether then try and return to my app you're right back at the facebook/twitter screen instead of in my app. This is only happening on iphon because on android they have a back button. The only way to get back into the app is to restart the iphone/ipod to get back to open
the app from beginning. I cannot have this as the only option for
people to share from my app as it would be horrible and could ruin my
app before I launch it. They say their is no way to fix it but Im sure its fixable so I am trying to get any info on this that I can.
The other issue is the facebook post itself. currently it post like this
Sent from Appname(with link to app)
www.appname
Text here
but this is kinda counter intuitive because the actual message should
be on top otherwise it will get lost in the other text. They said
this is the only way facebook allows it. Is it possible to get it like this
Text here
Sent from appname(linke here)
www.appname.com
Again any help on these two issues would be great so I can pass the
info to my developers.

Related

What's the correct way to authorize PhoneGap application to the Facebook?

I spent a while already to fix annoying issue with Facebook in PhoneGap app. And still a lot of things goes wrong with that. The thing is that I use Appery.io and Facebook plugin.
This is how my Facebook console looks now:
I suggest that localhost might be a reason of the issue. However, I got it into Facebook_Helper.js:
Everytime I try to sign in with FB account, I get the same error at the child window:
So what I've got is that app is authorized at this moment indeed, because there's a menu button at the navbar that allows me to navigate through FB profile:
The first issue lies in that the child window never gets closed automatically once user submitted Sign In form. And the second one is that I can't get the access token to the app directly. I know I'm doing something wrong, but I spend more than a week on that and nothing was clarified.
Honestly, I've no idea why it's not working. I saw a lot of apps written in PhoneGap that use the same authorization too, and they work as it should. Will be appreciate if you take a look into that and, maybe, advice something.
First, I don't see iOS or Android in your developer.facebook screenshot.
Second, you should implement native facebook integration if you are developing an app, if I understand correctly from your code, you are trying to handle only web browser version of authentication. Native integration is both the suggested way by facebook and platforms and better experience for end users. If users have facebook app installed, authenticating over fb app is more secure after all..
You can use a cordova plugin for facebook integration, here is one of the plugins (I am one of the authors): cordova-facebook plugin

FB.feed dialog looks different depending on login

This question is related to the question linked below, but instead deals with the interactive console included with the Facebook SDK:
Facebook Post to wall FB.Feed issue in Unity Facebook SDK
I have two screenshots to show the issue I'm having. This first screenshot is the FB.Feed dialog I get the first time I allow the app permission to post to my wall. It also shows if I invoke the dialog and I've given NO permission for it to post.
This particular dialog has trouble displaying the app's icon. It also grays out the entire screen, and doesn't allow any click throughs to the Unity app running, which is ideal but is different than the behavior of the other dialog, which I'll show next.
Here is the second screenshot, taken after refreshing the application page. The background app is not grayed out, and in my application, you can click through to the app in the background and interact with it, right through the dialog box. Obviously, this is not ideal.
So my questions are, what's causing these dialogs to change, and how can I make the API show the one that I want?
The first one happens only when the person first allows your app. First time a person allows your app they will see the normal javascript dialogs. However, if they come back to your game, they will see the second dialog that occurs inside your game.
We prevent a normal click-through in our dialogs that should be enforced by Unity's Modal Window: https://docs.unity3d.com/Documentation/ScriptReference/GUI.ModalWindow.html
However, it looks like Unity has a bug on their end that might clicks through. I've messaged Unity and they are now aware of the issue. Thanks for reporting that.

How to relaunch an app like facebook-ios-sdk does?

Question:
I am actively looking in the source code on Github's facebook-ios-sdk project myself but I was wondering if anyone already knows how to relaunch an app that sent an iPhone user to Safari, such that the user can come back after some work has been finished?
Example:
When using facebook to login, the original app is relaunched after the facebook login page has authenticated the user.
Motivation:
I would like to be able to do the same for youtube videos without having to completely lose the user. I don't want to use the standard webview approach because I don't want to provide extra space to first let the video load for the user and then have the user click the play button. I want to skip the play button and its associated click entirely! Instead I want the user to be able to click on just an everyday regular iPhone button and be shown the video with the navigation for coming back to the app via relaunch.
You need your app to register a "custom URL scheme". Then get the callback in the remote web service to return a URL with that scheme. iOS will then launch your application.
More (somewhat old) info available here.
A list of common custom URL schems on iOS can be found here.
Generally, as part of the OAuth login process, you supply a callback URL as one of the paramaters. What this does, is tell the remote server (YouTube), that on successful authentication, redirect the user to the supplied URL. If YouTube supports this (does it support OAuth?) then on successful user login within safari, youtube will tell users safari to redirect to the supplied url. If this url is a "custom URL scheme" it will cause your app to relaunch and you can handle the situation from there.

Can an iPhone app generate web clips?

The safari browser lets you add an icon to the home screen as a bookmark to whatever webpage you happen to be on. I would want to do that same thing, but in an app I develop. So basically, the user would launch the app, do a bunch of stuff and somewhere along the way, a web clip would be created and pushed to their home screen (with their consent of course). Is this possible, or is it a feature exclusive to the Safari browser? It seems like this sort of thing could be done, but it also seems like it could be viewed as spam and therefore a reason for Apple to reject the app outright. Is this sort of thing feasible? If so, I would be very thankful for a link on where I could read up on how to go about it.
It seems unlikely that the iOS app security sandbox would allow an app to directly add web pages to the home screen.
Best bet might be to upload the webpage to some site, and then launch Safari with a URL to the webpage on that site, after requesting that the user manually "clip" that site using Safari.

problem with UIWebview and link to App Store

In my iPhone application I have a UIWebview that shows an html page. Inside that page there are links that should lead the user to the iTunes application and the application they tapped on. However, when the user taps on the link it errors out with 'too many redirects'. Looking at it with a packet sniffer I see it just keeps redirecting to the same http://phobos.apple.com/... URL. I even tried changing the link scheme to 'itms://' but that results in a 'Cannot show URL' error. I could solve this problem by trapping the URLRequest and sending openURL: to the UIApplication but the app has already been deployed and I don't want to patch it. I rather do it on the html/js/server side if possible. Anyone have any ideas?
For anyone still searching for this answer, I found that it seems to be a problem on the simulator which doesn't support itms:// URLs (because there's no App Store app). I didn't see the same issue on hardware, where the App Store app opens just fine (in my case this was when testing URLs from AdMob adverts, but it's probably the same for UIWebView).