Using Browser I want to do open a url,for doing payment - iphone

In my iPhone app using Browser I want to open a url for processing a payment.
When webpage loads a button is displayed, on clicking the button a new page opens in a new window.
On that page user enters the payment details and payment is processed.
After payment we are directed to a success page.
The question is, how do I return to my application after payment?

If you own the success page, then you could define your own URI scheme, that will automatically open your application on the device. This is how some links open the iTunes app, via an itms:// URI scheme.
A good way to deal with this can be seen here:
Possible to handle your own http URL schemes in iOS?

Related

Third party authentication doesn't work from facebook browser

I have a web application (React js with Kotlin backend) that has normal email + pw (plus PIN) login, and it also supports 3rd party authentication (Google and Facebook). It works on mobile and web, however, when I open my webpage through Facebook app - which opens it's own browser - and try to log in with 3rd party authentication, I can click on that "Continue as me" button, but then the page refreshes and I'm not logged in. I saw the same thing happen on other sites too, e.g. Figma, Pinterest, etc. I thought it's impossible to log in this way anymore, however, I just noticed that you can actually log in to Stackoverflow this way (so facebook app -> facebook browser -> stack overflow -> 3rd party auth and it works).
Has anyone figured it out how it was possible for Stackoverflow to do this?
Ok, I found the solution. The problem was that when a user clicked on 'Login with FB' button on my site, I sent a request to fb to get back a content of a login window and I created a pop up window where I rendered it, I put on a listener on that pop up window and once it was done, then I got the access token and sent it to backend and logged the user in. On a normal browser it works perfect (both pc and mobile) but as I mentioned above it didn't work in an in app browser like facebook app.
The issue was that facebook app opens a website in it's own browser that doesn't handle any pop ups, so after a successful authentication I saw that nothing happened and it was because we were not redirected to the original window where we should have, and it had the token in the url. So the solution was instead of making this pop up window for FB login, just redirect the user to the fb login page (and stay on the same window), and once the login is successful, just handle the token as is.

Is it possible to deeplink from a facebook post to an app and does it need to be approved by facebook?

I would like to have my app post to facebook and then when "friends" see the link, they can click on it and since it is a deeplink, clicking on it would take the user to the app store if the app isnt downloaded otherwise it would take them to the correct page of the app. Would this need approval from Facebook?
No approval needed, but in most cases this is currently not possible — Facebook has decided to block the functionality. The best option is to post a link pointing to a page on your website, and then open your app from there.
In other words, you can't open a link from the news feed and have it launch the app. However you can open a link to your website, and once the website is open you can launch your app successfully from there. This is the approach we currently use at Branch.io

How to update user's page using express checkout

I would like to implement the in-context checkout that enables users to pay for a good and without having to reload another page (other than the paypal payment window) access the content. As I currently understand the process, the client will request my server for the paypal url to initiate the transaction. I will request paypal and send their PAYMENTURL as a response then if they complete the transaction they will be redirected to the url I provided paypal, but how can I then notify the client page that it is allowed to access the content without having them reload?
If you need a clearer example they have a mock website where there is a video playing, at some mark the video stops and then if you pay the video is then fully streamed, however the user did not have to reload the page for those changes to take place.
I see that you don't want to reload the page ,so for example if you want to display the "Congratulations page" as shown in the demo
you could either do :
Do a ajax call , so once the payment is complete, the lightbox is closed and make a ajax call to update the client page.
Once lightbox is closed, display another pop up window to display the "Congratulations page" and prompt user to close it.

How to get app title/link directed over to a website?

You know the publishing apps on Facebook: "Published via ____".
I've see a few times where when you click on the app name, it goes directly to the provider's website? (For example, if I clicked on it, it would direct to www.mywebsite.com)
For the life of me, I can't figure out how they make that work. Can't find a setting in the developer app.
Any ideas?
Thanks!
This is just done via a facebook page or application. If you create the facebook application, and post content via the application, it will automatically show the "Published via ..." at the bottom.
What it does is redirect you to the application page (so FB can track the number of clicks) then it will auto redirect to the website url page specified in the application settings.
Here is a tutorial

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.