#Profile Sharing SDK
###Project Goal
Use a custom SDK to open native PayPal login screen with the help of Profile Sharing use case by PayPal iOS SDK. After successful login, the goal is to transition to NextViewController
.
###Current Issues
-
There is no smooth transition to
NextViewController
after successful login. Refer to the animation below. -
Use a completion handler (instead of delegation) to update the current view with success message. I have asked the same question on StackOverFlow, with a simplified example - http://stackoverflow.com/questions/26165235/update-completion-handler-outside-declared-method
-
A suggestion of eliminating the
PayPalViewController
from SDK, and replace it by a class derived fromNSObject
. Ideally, thegetUserPayPalAuthorization:completion:
method should not belong to a view controller class, but to some other class — such as a general utility class (derived fromNSObject
).
###Animation
###Instructions for building the reference implementation -
-
Open
TestingLaunchPayPalSDK.xcodeproj
in Xcode Version 6.0.1 or later. -
Build the project Command (⌘) + R
-
Enter mock data as your credentials. The
PayPalNoNetwork
environment is enabled. -
After entering credentials, the 'success' keyword is intercepted. Notice transition to
NextViewController
of the SampleApp.
###Instructions for building a universal binary
-
Open LaunchPayPalSDK.xcodeproj in Xcode 6.0.1 or later. Make sure you choose the 'UniversalLibrary' scheme.
-
Build the project Command (⌘) + R
-
Under Products, right click on
libLaunchPayPalSDK.a
. ChooseDebug-universal
folder. -
Link the
libLaunchPayPalSDK.a
andPayPalViewController.h
to your reference implementation.
###Response
This authorization response is a NSDictionary object which can be seen in a debug window. Example:
Response:
{
client = {
environment = mock;
"paypal_sdk_version" = "2.3.2";
platform = iOS;
"product_name" = "PayPal iOS SDK";
};
response = {
code = "EJhi9jOPswug9TDOv93qg4Y28xIlqPDpAoqd7biDLpeGCPvORHjP1Fh4CbFPgKMGCHejdDwe9w1uDWnjPCp1lkaFBjVmjvjpFtnr6z1YeBbmfZYqa9faQT_71dmgZhMIFVkbi4yO7hk0LBHXt_wtdsw";
};
"response_type" = "authorization_code";
}