integration paypal with ios - ios

I am developing an application where I need to integrate payments with PayPal, I have downloaded the PayPal iOS SDK,
everything works perfectly with the sandbox but now I do not know how to switch the mode for production.
any help would be apprediated.

The PayPal SDK is fine if you go for physical goods.
Regarding your question: to switch to live you just need to remove this line
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentNoNetwork];

The sample code you are probably following in the iOS integration docs sets the environment to PayPalEnvironmentNoNetwork:
// Start out working with the test environment!
// When you are ready, remove this line to switch to live.
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentNoNetwork];
You could just remove that line to go live, since the default is PayPalEnvironmentProduction.
However, you probably want to test your integration before going live by changing the environment to PayPalEnvironmentSandbox:
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentSandbox];
You can create sandbox accounts over here.
When switching to production, rather than deleting the line, it is safer and clearer to be explicit:
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentProduction];
See also PayPalPaymentViewController.h documentation on environments.

//for testing
[PayPalPaymentViewController setEnvironment:self.environment];
//for Paypal live app than it set in our app code
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentProduction];
//check in Paypal sandbox account
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentSandbox];

In PaymentMethodViewController
Replace PayPalEnvironmentSandbox with PayPalEnviromentProduction of kPayPalEnvironment global variable.
Set live credentials of paypal account.

Related

Xamarin forms how to log in with Apple account

I'm trying to publish my first xamarin forms app on IOS. I barred the issue of login with the Apple account.
I have 4 questions, please.
1- If I implement Sign in with Apple only for IOS 13+ will it be accepted? :(
2- I'm trying to use Xamarin Essentials to log in to IOS 13+ as shown in this article:
Xamarin Essentials
// Use Native Apple Sign In API's
r = await AppleSignInAuthenticator.AuthenticateAsync();
But I only get back the idToken. AccessToken, name and mail return null. Am I missing something?
3 - And finally I tried to use the plugin.firebaseAuth version 4.0.0-pre01:
Link plugin
// For iOS
var credential = CrossFirebaseAuth.Current.OAuthProvider.GetCredential("apple.com", idToken, rawNonce: rawNonce);
var result = await CrossFirebaseAuth.Current.Instance.SignInWithCredentialAsync(credential);
// For Android
var provider = new OAuthProvider("apple.com");
var result = await CrossFirebaseAuth.Current.Instance.SignInWithProviderAsync(provider);
It provides an example using prism to deal with this, but when I install the plugin in this version the application is no more than a splash screen and closes, without showing an error in the output. What am I doing wrong? :(
The first link seems promising for iOS less than 13 and Android using Asp.NET. However in the application I use only the Firebase ClouFirestone and Firebase Hosting for the Administrative Panel. Is it possible for me to sign in Apple without the services of a different backend?
I am very grateful for any light on the path I must follow
1- If I implement Sign in with Apple only for IOS 13+ will it be accepted?
It depends, if they don't find any other issues or violation, it will get accepted.
2- I'm trying to use Xamarin Essentials to log in to IOS 13+ as shown in this article: But I only get back the idToken.
Apple will only provide you the requested details on the first authentication. After that first authentication, you will only get the User Id so be sure to store the details that first time in case you need them.
This feature needs to be tested on a physical device running iOS 13. The simulator is not reliable, it doesn’t always work properly.
Should follow the design guidelines when implementing Apple Sign In. You can find it here: https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/

How to set FacebookUrlSchemeSuffix build hint in Codename One

I have two free and paid apps which use same one Facebook app.
The free app has package: com.company.app
The paid app has package: com.company.app.free
The facebook app has id is 123456 and the iOS platform section in Facebook app:
"Bundle ID": com.company.app.free, com.company.app
"URL Scheme Suffix": free, paid
I can't logon the facebook in freeApp because the facebook always redirects to the paidApp.
After spend time, I found the Two iOS apps using the same Facebook app ID - is it possible? and https://developers.facebook.com/docs/ios/troubleshooting#sharedappid and try:
Add the ios.FacebookUrlSchemeSuffix="free" for freeApp and ios.FacebookUrlSchemeSuffix="paid" for paidApp but the problem is still same.
Then remove the ios.FacebookUrlSchemeSuffix build hint above, add the ios.plistInject=< key>FacebookUrlSchemeSuffix< /key>< string>free < /string> for freeApp and test it. The app is terminated immediately when start logon the facebook.
Then add the ios.urlScheme=fb123456 to the freeApp but the build is failed at server with error "...Info.plist': The data couldn’t be read because it isn’t in the correct format."
What are correct setting for ios.urlScheme and ios.plistInject build hints (include the FacebookUrlSchemeSuffix) in order for both freeApp and paidApp can work correctly in Codename One?
ios.urlScheme
Allows intercepting a URL call using the syntax
urlPrefix
From: https://www.codenameone.com/manual/advanced-topics.html
Notice that by default defining Facebook support includes the main URL scheme so the plistInject will conflict with that.

paypal sandbox to live in ios

I am using paypal Sdk(https://github.com/paypal/PayPal-iOS-SDK) in my iPhone app.I was successfully integrated and tested in sandbox mode. I have given client for production in appdlegate file.I changed the environment to "PayPalEnvironmentProduction". I have some doubts regarding while changing to live.
[PayPalMobile initializeWithClientIdsForEnvironments:#{PayPalEnvironmentProduction : #"YOUR_CLIENT_ID_FOR_PRODUCTION",
PayPalEnvironmentSandbox : #"YOUR_CLIENT_ID_FOR_SANDBOX"}];
what is the use of "endpoint" and "secret" in my app credentials (because i used Only client id)
shall i need to submit the app to paypal to get any other credentials from paypal or directly to Appstore
will my app is approved by apple if i use paypal
what is the use of below code (even though i removed code )payment process is working
_payPalConfig = [[PayPalConfiguration alloc] init];
_payPalConfig.acceptCreditCards = YES;
_payPalConfig.languageOrLocale = #"en";
_payPalConfig.merchantName = #"Awesome Shirts, Inc.";
_payPalConfig.merchantPrivacyPolicyURL = [NSURL URLWithString:#"https://www.paypal.com/webapps/mpp/ua/privacy-full"];
_payPalConfig.merchantUserAgreementURL = [NSURL URLWithString:#"https://www.paypal.com/webapps/mpp/ua/useragreement-full"];
If it is necessary to submit the app to paypal first what are the necessary steps to taken and any detailed expalanation may be helpful.what is difference between paypalSdk and MPL, which is better?
Dave from PayPal here.
1 what is the use of "endpoint" and "secret" in my app credentials (because i used Only client id)
Client id is the only credential that you need to use with the PayPal iOS SDK.
2 shall i need to submit the app to paypal to get any other credentials from paypal or directly to Appstore
No.
3 will my app is approved by apple if i use paypal
Many apps using the PayPal iOS SDK have already been approved by Apple.
4 what is the use of below code (even though i removed code )payment process is working
This is all explained in the documentation and the header files.
If it is necessary to submit the app to paypal first what are the necessary steps to taken
It is not necessary to submit your app to PayPal.
any detailed expalanation may be helpful.what is difference between paypalSdk and MPL, which is better?
The PayPal iOS SDK is the one which we will continue to support into the future. The only reason to use the older MPL library is if you need features which are not yet supported in the PayPal iOS SDK and the REST APIs on which it relies.

"Login cancelled by player" callback in facebook api for Unity IOS (only if you have facebook app in device)

I am using unity facebook api 4.3.6 for ios. Its working perfectly fine if I don't have #facebookapp in my device. Once I download it and try login, it takes me to #facebookapp and redirect again to my game with callback
FB Login callback : {"is_logged_in":false, "user_id":"", "access_token":""}
Login cancelled by player
This happens only if I have facebook app downloaded! I think its some how cache issue but not sure exactly what is it. Any luck?
I believe this is not connected with Unity.
Here is few reasons I faced
You need to ask read and write permissions separately. Wait until you get read permissions than send request for write permission.
Make sure your app is allowed to login ( if you have FB app installed on your device )
Make sure you have your app bundle identifier added to developer.facebook.com
Here is what helped me fixed that problem with Unity Facebook-Android.
setting the sandbox mode ON:
Go to https://developers.facebook.com/apps
Select the respective app from the drop down.
Go to 'Status & Review' from the table in the left side of the page.
Do you want to make this app and all its live features available to the general public? - Select switch to set YES/NO value.
if the ON/OFF button is disable, please go back to Settings and enter a valid email address.
I understood why when the device is installed a facebook app, my app can't login facebook.
First : software OpenSSL create keyhass wrong. I have downloaded OpenSSL from here : http://code.google.com/p/openssl-for-windows/downloads/list , and it creates keyhash wrong.
I have used other OpenSSL sofware, you can download it here : https://www.dropbox.com/sh/t6tt44dc2nm6vza/6mp1W74GiZ , it is create keshash right.
Second: In class FacebookAndroidUtil.cs , line 62, you add System.Environment.GetEnvironmentVariable("HOMEDRIVE") before System.Environment.GetEnvironmentVariable("HOMEPATH"). Facebook SDK requires a file debug.keystore in : C:\Users\UserName.android\debug.keystore.
If the Unity Editor, Edit Setting Facebook has yet to create android debug hash key. Then use the Eclipse Software, create and run onr any project. Eclipse will generate a debug.keystore. If it is't create in folfer : C:\Users\UserName.android\debug.keystore , then find it, coppy and paste into C:\Users\UserName.android\debug.keystore
Third: publish your app in Facebook, so be sure it is:"This app is public and available to all users".

Where exactly should I put the call to [FBSettings publishInstall:appId]

I'm looking at integrating support for tracking Facebook's new mobile app ads.
I've read the tutorial here:
https://developers.facebook.com/docs/tutorials/mobile-app-ads/
It says:
Include the following code to be executed when your app opens for the first time by user
[FBSettings publishInstall:appId];
So the first question is - where do I put this so that it only invokes the call if the install was driven from Facebook? I don't want FB to get credit for someone who found my app themselves on the app store.
Do I need to manually track whether or not I've called the publishInstall before for this specific user? (The preamble sentence implies this - but the SDK documentation for publishInstall implies otherwise).
And even more confusing is that the SDK FBSettings reference includes shouldAutoPublishInstall which defaults to YES. This would suggest that I don't need to do anything other than have the SDK integrated. So why does the tutorial not mention this as an option?
I assume that the appId is the associated Facebook appId (as opposed to the App Store App ID). This is also not clear from the documentation.
I browsed the sources of facebook iOS SDK, and it seems that guide is wrong.
You are right, that autoPublishInstall is set to YES by default, which means we don't need to invoke [FBSettings publishInstall:appId]; manually. AppId is indeed the facebook app id.
When you invoke openActiveSessionWith.... method, it initializes FBSession with
initWithAppID:permissions:defaultAudience:urlSchemeSuffix:tokenCacheStrategy: which contains in the end [FBSettings autoPublishInstall:self.appID];
+ (void)autoPublishInstall:(NSString *)appID {
if ([FBSettings shouldAutoPublishInstall]) {
dispatch_once(&g_publishInstallOnceToken, ^{
// dispatch_once is great, but not re-entrant. Inside publishInstall we use FBRequest, which will
// cause this function to get invoked a second time. By scheduling the work, we can sidestep the problem.
[[FBSettings class] performSelector:#selector(publishInstall:) withObject:appID afterDelay:FBPublishDelay];
});
}
}
So technically it should report the install out of the box (if I'm not missing something). I'm going to play with it a little more today to see if it works as expected and update answer with results.
Just put it at -[application:didFinishLaunchingWithOptions].
Not all of the apps want to integrate the Facebook login. They only want the feature "mobile app install ads". For these kind of app, they should invoke +[FBSettings publishInstall:appId] manually. On the other hand, if your app has already integrated facebook login, you can assume that the FB sdk has published the installation.
If we just have to put
[FBSettings publishInstall:appId];
manually in
-[application:didFinishLaunchingWithOptions]
how will I identify which install happened from facebook? I don't want FB to get credit for someone who found my app themselves on the app store.
put the code in Appdelegate DidbecomeActive method
- (void)applicationDidBecomeActive:(UIApplication *)application
hope this help :)

Resources