Skip to content

GoMarketMe/gomarketme-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoMarketMe

GoMarketMe Swift

Affiliate Marketing for iOS Applications.



Installation

Swift Package Manager

  • File > Swift Packages > Add Package Dependency
  • Add https://github.com/GoMarketMe/gomarketme-swift.git
  • Select "Exact Version" > "2.1.0"

Using an older version of Xcode? Do this instead:

  • Navigate to the project navigator and select your project or the blue project icon.
  • Package Dependencies > Add a New Package > +
  • In the search bar that appears, enter https://github.com/GoMarketMe/gomarketme-swift.git
  • Press "Add Package"

Usage

Import Library

import GoMarketMe

Initialize Client

private let goMarketMe = GoMarketMe.shared

init() {
    goMarketMe.initialize(apiKey: "API_KEY") // Initialize with your API key
}

Sync the Transaction (Recommended)

// Step 1: Retrieve the product
// Step 2: Attempt the purchase
// Step 3: Handle the purchase result
switch result { 
case .success(let verification):
    if case .verified(let transaction) = verification {

        // RevenueCat user or don't have access to the transaction? 
        // Use the following instead: await goMarketMe.syncAllTransactions().
        await goMarketMe.syncTransaction(transaction: transaction) // <- add this line for faster processing
    }
}

Make sure to replace API_KEY with your actual GoMarketMe API key. You can find it on the onboarding page and under Profile > API Key.

Check out our sample app for an example.

About

Affiliate Marketing for native iOS Apps.

Topics

Resources

License

Stars

Watchers

Forks

Languages