DEV Community

Richie
Richie

Posted on

How to Integrate anyIPSDK in Your Swift App in Just 15 Minutes

TL;DR

I integrated anyIPSDK as an additional revenue stream for my iOS app. It runs alongside my existing ad system with no performance impact, doesn't collect user data, and provides a passive income stream based on my DAUs. Implementation is just a few lines of code with a straightforward Swift package integration.


Hey fellow devs! After struggling to monetize my iOS app beyond traditional ads, I recently tried out anyIPSDK and was surprised by how quick the integration was. I thought I'd share my experience in case it helps anyone else looking for alternative revenue streams.

What I Found Out About anyIP-SDK

I was skeptical at first (as we all should be with SDKs), but after getting the code and running tests, it turned out to be a pretty decent way to get passive revenue!

What convinced me to try it:

  • It runs in the background while my app is active without any UI changes or user interruptions
  • The performance impact was minimal - I monitored CPU usage before and after
  • It's privacy compliant (important since my user base is mostly in Europe)
  • I didn't have to change my existing AdMob implementation
  • Works across platforms (I'm planning a macOS version of my app soon)

Here's how I implemented it in about 15 minutes.

Step 1: Getting It Installed

I was contacted by anyIP SDK team and got access to their swift-sdk package. Then it pretty basic:

  1. Unarchived it to my dev folder
  2. Opened my project in Xcode
  3. Went to "Package Dependencies" in project settings
  4. Clicked "+" and selected "Add Local..."
  5. Browsed to the SDK directory
  6. Added it to my project

This was straightforward - just a standard local Swift package. Xcode handled the dependencies without any issues.

Step 2: Initializing in My Code

After installation, I added this to my project:

import DemoSDK

// Initialize with the API key they provided
do {
    let sdk = try DemoSDK(
        apiKey: "my_api_key",
        eulaAccepted: true,  // I only set this after getting user consent
        environment: .production
    )

    // Start it up
    sdk.start {
        print("SDK started successfully!")
    } failure: { error in
        print("Unable to start SDK: \(error)")
    }
} catch {
    print("Failed to initialize SDK: \(error)")
}

Enter fullscreen mode Exit fullscreen mode

In this code:

  • I import the DemoSDK module.
  • Initialize it with the API key (which you'll receive from the anyIP team).
  • The eulaAccepted parameter should only be set to true after the user has accepted your app's End User License Agreement.
  • We specify the production environment (I spent some time looking through the SDK code and testing before implementing this just to be safe, but it’s not complicated than this).
  • Finally, we call the start() method with success and failure callbacks.

It’s completely transparent and it didn’t impact my app's launch time at all.

Step 3: Setting Up Automatic Launch

To make this completely hands-off, I decided to launch the SDK at app startup:

class AppDelegate: NSObject, UIApplicationDelegate {
    var sdk: DemoSDK? = nil

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        // I tie this to my app's existing EULA acceptance
        let eulaIsAccepted = UserDefaults.standard.bool(forKey: "user_accepted_eula")

        if eulaIsAccepted {
            sdk = try? DemoSDK(apiKey: "my_api_key", eulaAccepted: true)
            sdk?.start(success: nil, failure: nil)
        }

        return true
    }

    func applicationWillTerminate(_ application: UIApplication) {
        sdk?.stop()
    }
}

Enter fullscreen mode Exit fullscreen mode

Since my app uses SwiftUI, I added this to register the AppDelegate (using the @UIApplicationDelegateAdaptor property wrapper):

@main
struct MyApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

Enter fullscreen mode Exit fullscreen mode

This setup ensures the SDK only runs when my app is active and the user has accepted my terms. It also handles proper shutdown.

Note that even if it’s a simple SDK, the implementation follows best practices for iOS app development.

What I Verified About Privacy and Resource Usage

I'm always cautious about third-party SDKs, so before releasing my update, I:

  • Examined the SDK source code for any privacy concerns
  • Confirmed it doesn't collect user information (this was a big deal for me)
  • Verified there's no cryptocurrency mining
  • Ran Instruments to check CPU/memory impact during extended usage

My Revenue Experience So Far

After about a month of using this in my app:

  • The revenue is based on daily active users who've accepted my EULA
  • Payment varies by user location (my US users generate more than others)
  • I still get my regular ad revenue - but with this SDK I can almost double it!
  • Payments have been reliable, hitting my account within 3 business days of month-end

It's not making me rich (yet), but as a passive additional stream alongside my existing monetization, it's definitely worth the 15-minute implementation time.

If you're considering trying it, feel free to ask me questions in the comments, happy to share more specifics about my experience.

Top comments (0)