Developer's Guide

Mobile Payments Library Developer Guide and Reference –iOS Edition August 2012 9
In either case, you need to make sure the initialization is successful by sending an
initializationStatus message to the PayPal object.
The following table lists the possible status values returned from the
initializationStatus
query:
Status Definition
STATUS_NOT_STARTED Initialization never attempted.
STATUS_COMPLETED_SUCCESS Initialization completed successfully.
STATUS_COMPLETED_ERROR Initialization completed with errors. The error is displayed in
the device or simulator logs.
STATUS_INPROGRESS Initialization in progress. Must wait until the current
initialization attempt completes before attempting to retry
initialization.
You can perform this check on the
viewDidLoad method of the UIViewController that will
contain the Pay with PayPal button.
An example to verify that the initialization process completed successfully is:
if ([PayPal initializationStatus] == STATUS_COMPLETED_SUCCESS) {
//We have successfully initialized and are ready to pay
} else {
//An error occurred
}
}
NOTES:
The Pay with PayPal button returned by the getPayButtonWithTarget method is
disabled until the initialization is complete. Once the initialization is complete, if it was
successful, the button is enabled.
When initialization status returns
STATUS_COMPLETED_ERROR - Request timeouts or
host unavailable (Network connection failure) are valid initialization error cases for
initializePayPal retry attempts.
If initialization failed due to a buyer error, the error message presents as a
UIAlertView.
+(PayPal*)initializeWithAppID:(NSString const *)PayPalApplicationID
(Optional:) forEnvironment:(PayPalEnvironment)env;