Paymentwall website uses cookies to store your browsing preferences on your device. However, cookies do not collect personal information.

For more information about how we use cookies, check our cookie policy

Close

Documentation

New Documentation Getting Started API Libraries APIs Checklists Flows Integrations Mobile SDKs Reference Smart TV SDK SpiderPipe Testing Payments
Contacts
If you still have questions regarding integration, please email us at devsupport@paymentwall.com

Mobiamo iOS SDK

Attachments

Accept in-app payments with Paymentwall’s advanced mobile payment solution. Mobiamo is a mobile carrier billing platform with global coverage. Our iOS SDK was designed to enable 1-click payments via mobile carrier billing within your mobile application.

All you have to do is to import the library into your iOS project and start using our SDK to accept in-app payments. It is quick and easy! We'll guide you through the process here.

How does it work ?

  1. The customer can make a purchase, simply by clicking on the buy button inside your application.
  2. The Mobiamo SDK is called at this moment and displays a pop up dialog with the payment information.
  3. User confirms the payment simply by clicking on the “Buy” button.
  4. The payment is completed and your callback function is triggered to handle its result. We will also notify your backend about this event.

Requirements

  1. MessageUI.framework
  2. CoreTelephony.framework

Credentials

Your mobile integration requires a Project key.
You can obtain these Paymentwall API credentials in the application settings of your Merchant Account at paymentwall.com

Add SDK to your project

  1. In the menubar click "File" then "Add file to YOUR_PROJECT".
  2. Select the "MobiamoSDK" directory in the downloaded repository.
  3. Make sure 'Copy items into destination group's folder (if needed)' is checked.
  4. Click "Add"
  5. Click on your project, in Targets tab click in "Build Settings"
  6. In the "Header Search Paths" add link to include file of SDK such as "$SOURCE_ROOT/MobiamoSDK/include"
  7. In the "Library Search Paths" add link to file "MobiamoSDK.a"
  8. In "Build Phases" tab add "MobiamoResources.bundle" to "Copy Bundle Resources"

Accepting your first payment

Import

Objective-C
#import "MobiamoSDK.h"
Swift

Add this command to your Bridging-Header.h file

#import "MobiamoSDK.h"

Create Mobiamo request

Firstly, you need to provide your project key and set your product's id and name. Both can be strings up to 255 characters. Secondly, you should also specify the user identifier; it can be your internal in-app ID of the user or any other identifier. Last but not least, please contact PW supporting team to activate in backend by allowing mobiamo pinless for your project. See example below:

Objective-C
[MobiamoSDK setApplicationKey: YOUR_APPLICATION_HERE userID:YOUR_USER_ID productID:PRODUCT_ID productName:PRODUCT_NAME price: PRICE andCurrency:CURRENCY];
Swift
MobiamoSDK.setApplicationKey(YOUR_APPLICATION_HERE, userID: YOUR_USER_ID, productID: PRODUCT_ID, productName: PRODUCT_NAME, price: PRICE, andCurrency: CURRENCY)

Choose you wish to implement. Currently Mobiamo SDK supports 2 flows:

Price point selection

On the payment popup the user will be able to choose which price point they prefer to complete the payment with. In other words, you can provide the user with predetermined price options (i.e you can offer 100 credits for 1 USD or 1000 credits for 10 USD). Please note that the range of price points is limited using mobile payments, so in most cases you can’t set custom values.

Mobiamo iOS SDK

All you need to do is create an intent and run the process:

Objective-C
[MobiamoSDK setApplicationKey: YOUR_APPLICATION_HERE userID:YOUR_USER_ID productID:PRODUCT_ID productName:PRODUCT_NAME price:@"" andCurrency:@""];
MobiamoViewController *viewController = [MobiamoSDK createNewMobiamoViewController];
viewController.delegate = self;
[viewController showMobiamoWithParentViewController:self completion:^(int code){

}];
Swift
MobiamoSDK.setApplicationKey(YOUR_APPLICATION_HERE, userID: YOUR_USER_ID, productID: PRODUCT_ID, productName: PRODUCT_NAME, price: "", andCurrency: "")
var viewController: MobiamoViewController = MobiamoSDK.createNewMobiamoViewController()
viewController.delegate = self
viewController.showMobiamoWithParentViewController(self, completion:{ (code) -> Void in

})

Price point preselected

When you know which exact price you want to be charged (let’s say you’ve cached all available price points) you can force Mobiamo SDK to charge this exact amount. The user will not see the price points selection drop down.

Mobiamo iOS SDK

For this case, you need to add additional parameters of amount and currency to the MobiamoRequest:

Objective-C
[MobiamoSDK setApplicationKey: YOUR_APPLICATION_HERE userID:YOUR_USER_ID productID:PRODUCT_ID productName:PRODUCT_NAME price: PRICE andCurrency:CURRENCY];
MobiamoViewController *viewcontroller = [MobiamoSDK createNewMobiamoViewController];
viewcontroller.delegate = self;
[viewcontroller showMobiamoWithParentViewController:self completion:^(int code){

}];
Swift
MobiamoSDK.setApplicationKey(YOUR_APPLICATION_HERE, userID: YOUR_USER_ID, productID: PRODUCT_ID, productName: PRODUCT_NAME, price: PRICE, andCurrency: CURRENCY)
var viewController: MobiamoViewController = MobiamoSDK.createNewMobiamoViewController()
viewController.delegate = self
viewController.showMobiamoWithParentViewController(self, completion:{ (code) -> Void in

})

Result handling

You have to add MobiamoSDKDelegate to your ViewController:

Objective-C
@interface YourViewController : UIViewController <MobiamoSDKDelegate>
Swift
class YourViewController: UIViewController, MobiamoSDKDelegate

You can handle payment results by defining your callback function. We recommend syncing up with your server at this stage to sync up user's balance, confirm purchased item etc. See the example:

Objective-C
#pragma mark - Mobiamo SDK Delegate
-(void)mobiamoResponse:(MobiamoResponse *)response
{
    switch (response.responseCode) {
        case MOBIAMO_SUCCESSFUL:
            break;
        case MOBIAMO_FAILED:
            break;
        case MOBIAMO_CANCEL:
            break;

        default:
            break;
    }
}
Swift
// MARK:- Mobiamo SDK Delegate
func mobiamoResponse(response: MobiamoResponse!) {
    switch response.responseCode {
    case Int32(MOBIAMO_SUCCESSFUL.value):
        break
    case Int32(MOBIAMO_FAILED.value):
        break
    case Int32(MOBIAMO_CANCEL.value):
        break
    default:
        break
    }
}

responseCode code can get one of the following values:

MOBIAMO_SUCCESSFUL: user has completed the payment

MOBIAMO_FAILED: user has aborted the payment

MOBIAMO_CANCEL: can't connect to Mobiamo system due to network/SSL/parameters error.

MobiamoResponse object stores all the information about the payment like payment amount, product name, product ID which was set before.

Server notification handling

After each successful payment we will notify your server about it. We recommend to use this feature as it is the most reliable way to know when the payment went through. Even if your application crashes for some reason, your server will still be notified, so you can sync up later.

Please use pingback processing documentation for more information.

In order to download and install the Mobiamo iOS SDK, please contact us at devsupport@paymentwall.com

This page needs JavaScript
Your browser is
not supported anymore.
Please update to the more recent one.
This page needs JavaScript
This page needs JavaScript.
Please enable it in your browser settings and try again.
We use cookies on this website to make your browsing experience better. By using the Paymentwall website you agree to our Cookies Policy.