From e78e75c921d861e4394b80bbebae093e2004b4d1 Mon Sep 17 00:00:00 2001 From: rishh18 Date: Thu, 9 Jan 2025 12:52:38 +0530 Subject: [PATCH 1/4] Readme Added --- ApMobileSDK.podspec | 4 +- README.md | 405 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 407 insertions(+), 2 deletions(-) diff --git a/ApMobileSDK.podspec b/ApMobileSDK.podspec index fe0ee97..d5962a3 100644 --- a/ApMobileSDK.podspec +++ b/ApMobileSDK.podspec @@ -3,14 +3,14 @@ Pod::Spec.new do |spec| spec.name = "ApMobileSDK" - spec.version = "1.0.0" + spec.version = "v1.0.0" spec.summary = "ApMobileSDK provides full screen ad formats such as Smart Rewarded and Smart Interstitial ads for the iOS apps" spec.description = "ApMobileSDK is easy to implement SDK provides full screen ad formats such as Smart Rewarded and Smart Interstitial ads for the iOS apps it also provides in built logging functionality." spec.homepage = "https://github.com/adpushup/ApiOSSDK" spec.license = { :type => "Proprietary", :text => "LICENSE" } spec.author = { "rishh18" => "rishabh.tripathi@adpushup.com" } spec.platform = :ios, "14.0" - spec.source = { :git => "https://github.com/adpushup/ApiOSSDK.git", :tag => "1.0.0" } + spec.source = { :git => "https://github.com/adpushup/ApiOSSDK.git", :tag => "v1.0.0" } spec.swift_version = "5.0" spec.vendored_frameworks = "Sources/ApMobileSDK.xcframework" spec.dependency "Google-Mobile-Ads-SDK" diff --git a/README.md b/README.md index 90bc051..62b73fe 100644 --- a/README.md +++ b/README.md @@ -1 +1,406 @@ # ApiOSSDK +## **Get started -** + + Follow this guide to get started with Ap Mobile SDK. + + The Ap Mobile SDK provides ad formats like Smart Interstitial and Smart Rewarded Ads. + + The following document shows how to integrate Ap Mobile SDK in your iOS App. + + You can use our demo apps as a reference project. + +## **Before you begin -** + + iOS version 14.0 and higher. + + Xcode version 15.3 or higher. + +Get the following IDs from AdPushup: + +- **Ad Manager App Id**: For Android Manifest File. +- **Ap App Id**: Used in initialising Ap Mobile SDK. +- **Ap Placement Ids**: Each Ad Unit has a unique placement Id. + +## **Configure your app -** + +Update info.plist file. + +- A `GADApplicationIdentifier` key with a string value of your Ad Manager app ID [found in the Ad Manager UI](https://support.google.com/admanager/answer/1656921) and of the form `ca-app-pub-################~##########`. +- A `SKAdNetworkItems` key with `SKAdNetworkIdentifier` values for Google (`cstr6suwn9.skadnetwork`) and [select third-party buyers](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/3p-skadnetworks) who have provided these values to Google. + + ```jsx + GADApplicationIdentifier + ca-app-pub-3940256099942544~1458002511 + SKAdNetworkItems + + + SKAdNetworkIdentifier + cstr6suwn9.skadnetwork + + + SKAdNetworkIdentifier + 4fzdc2evr5.skadnetwork + + + SKAdNetworkIdentifier + 2fnua5tdw4.skadnetwork + + + SKAdNetworkIdentifier + ydx93a7ass.skadnetwork + + + SKAdNetworkIdentifier + p78axxw29g.skadnetwork + + + SKAdNetworkIdentifier + v72qych5uu.skadnetwork + + + SKAdNetworkIdentifier + ludvb6z3bs.skadnetwork + + + SKAdNetworkIdentifier + cp8zw746q7.skadnetwork + + + SKAdNetworkIdentifier + 3sh42y64q3.skadnetwork + + + SKAdNetworkIdentifier + c6k4g5qg8m.skadnetwork + + + SKAdNetworkIdentifier + s39g8k73mm.skadnetwork + + + SKAdNetworkIdentifier + 3qy4746246.skadnetwork + + + SKAdNetworkIdentifier + hs6bdukanm.skadnetwork + + + SKAdNetworkIdentifier + mlmmfzh3r3.skadnetwork + + + SKAdNetworkIdentifier + v4nxqhlyqp.skadnetwork + + + SKAdNetworkIdentifier + wzmmz9fp6w.skadnetwork + + + SKAdNetworkIdentifier + su67r6k2v3.skadnetwork + + + SKAdNetworkIdentifier + yclnxrl5pm.skadnetwork + + + SKAdNetworkIdentifier + 7ug5zh24hu.skadnetwork + + + SKAdNetworkIdentifier + gta9lk7p23.skadnetwork + + + SKAdNetworkIdentifier + vutu7akeur.skadnetwork + + + SKAdNetworkIdentifier + y5ghdn5j9k.skadnetwork + + + SKAdNetworkIdentifier + v9wttpbfk9.skadnetwork + + + SKAdNetworkIdentifier + n38lu8286q.skadnetwork + + + SKAdNetworkIdentifier + 47vhws6wlr.skadnetwork + + + SKAdNetworkIdentifier + kbd757ywx3.skadnetwork + + + SKAdNetworkIdentifier + 9t245vhmpl.skadnetwork + + + SKAdNetworkIdentifier + a2p9lx4jpn.skadnetwork + + + SKAdNetworkIdentifier + 22mmun2rn5.skadnetwork + + + SKAdNetworkIdentifier + 4468km3ulz.skadnetwork + + + SKAdNetworkIdentifier + 2u9pt9hc89.skadnetwork + + + SKAdNetworkIdentifier + 8s468mfl3y.skadnetwork + + + SKAdNetworkIdentifier + ppxm28t8ap.skadnetwork + + + SKAdNetworkIdentifier + uw77j35x4d.skadnetwork + + + SKAdNetworkIdentifier + pwa73g5rt2.skadnetwork + + + SKAdNetworkIdentifier + 578prtvx9j.skadnetwork + + + SKAdNetworkIdentifier + 4dzt52r2t5.skadnetwork + + + SKAdNetworkIdentifier + tl55sbb4fm.skadnetwork + + + SKAdNetworkIdentifier + e5fvkxwrpn.skadnetwork + + + SKAdNetworkIdentifier + 8c4e2ghe7u.skadnetwork + + + SKAdNetworkIdentifier + 3rd42ekr43.skadnetwork + + + SKAdNetworkIdentifier + 3qcr597p9d.skadnetwork + + + ``` + + +Import SDK in the app. + +- Importing from Cocoapods. + - Just add this command in your Podfile. + pod ‘ApMobileSDK’ + - Then from the command line run: + + `pod install --repo-update` + + +- Importing from swift package manager. + - In Xcode, install the ApMobileSDK Swift Package by navigating to **File > Add Packages.** + - In the prompt that appears, search for the ApMobileSDK Swift Package GitHub repository. + + [https://github.com/adpushup/ApiOSSDK](https://github.com/adpushup/ApiOSSDK.git) + +- Importing through ApMobileSDK.xcframework file (in case if above methods are not working). + - In the ApiOSSDK in the Sources folder there is a ApMobileSDK.xcframework file, Download it. + - Drag and drop the ApMobileSDK.xcframework file in your project. + +## **Initialise the Ap Mobile SDK** + +- Swift example - Add the initialise function in app delegate application function. + + ```swift + import ApMobileSDK + + @main + class AppDelegate: UIResponder, UIApplicationDelegate { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + ApAppSDK.initialise(id: "testId") + // Override point for customisation after application launch. + return true + } + } + ``` + +- SwiftUI example - Call initialise in the @main class + + ```swift + import SwiftUI + import ApMobileSDK + + @main + struct ExampleApp: App { + var body: some Scene { + WindowGroup { + ContentView().onAppear { + ApAppSDK.initialise(id: "testId") + } + } + } + } + ``` + +- Objective C example - + + ```objectivec + #import "AppDelegate.h" + #import + + @implementation AppDelegate + + (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + // Initialize ApMobileSDK here + + [ApAppSDK initialiseWithId:@"testId"]; + return YES; + + } + ``` + + +## Ad Formats + +- Interstitial Ad - Interstitial ads are full-screen ads that cover the interface of their host app. They're typically displayed at natural transition points in the flow of an app, such as between activities or during the pause between levels in a game. When an app shows an interstitial ad, the user has the choice to either tap on the ad and continue to its destination or close it and return to the app. + + + **Implementation** + + - Swift example - + + ```swift + ApMobileSDK.showInterstitialAd(viewController: **self**, apPlacementID: "testPlacement", apInterstitialListener: **self**) + ``` + + - SwiftUI example - + + ```swift + .onAppear { + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let rootViewController = windowScene.windows.first(where: { $0.isKeyWindow })?.rootViewController { + ApAppSDK.showInterstitialAd(viewController: rootViewController, apPlacementID: "testPlacement", apInterstitialListener: self) + } + } + ``` + + - Objective C example - + + ```objectivec + [ApAppSDK showInterstitialAdWithViewController:self apPlacementID:@"testPlacement" apInterstitialListener:self]; + ``` + + +**Supported Callbacks** + +**func** onAdClicked() + +**func** onAdImpression() + +**func** adPresented() + +**func** onAdNotLoadedYet() + +**func** onAdFailToPresent(withError error: **any** Error) + +**func** onComplete() + +**func** onError(code: Int, message: String) + +**func** onAdDismissed() + +- Rewarded Ad - Ads that reward users for watching short videos and interacting with playable ads and surveys. You should ask the user to view a rewarded ad for a reward. If you want to show rewarded ads between the normal flow of the screens, Please use Rewarded Interstitial Ads instead. + + + **Implementation** + + - Check If Rewarded Ad is ready. + - Swift example - + + ```swift + if ApAppSDK.isRewardedAdReady(apPlacementID: “yourPlacementID”) { + //Code to show rewarded ad. + } + ``` + + - Objective C - + + ```objectivec + if ([ApAppSDK isRewardedAdReadyWithApPlacementID:@"yourPlacementID"]) { + //Code to show rewarded ad. + } + ``` + + - SwiftUI - + + ```swift + if ApAppSDK.isRewardedAdReady(apPlacementID: "yourPlacementID") { + //Code to show rewarded ad. + } + ``` + + + - Show Rewarded Ad. + - Swift example - + + ```swift + ApAppSDK.showRewardedAd(viewController: **self**, apPlacementID: "testPlacement", apRewardedListener: **self**) + ``` + + - Objective C - + + ```objectivec + [ApAppSDK showRewardedAdWithViewController:self apPlacementID:@"testPlacement" apRewardedlListener:self]; + ``` + + - SwiftUI - + + + ```swift + .onAppear { + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let rootViewController = windowScene.windows.first(where: { $0.isKeyWindow })?.rootViewController { + ApAppSDK.showRewardedAd(viewController: rootViewController, apPlacementID: "testPlacement", apRewardedListener: self) + } + } + ``` + + + **Supported Callbacks** + + **func** onAdClicked() + + **func** onAdImpression() + + **func** onAdShowed() + + **func** onAdDismissed() + + **func** onAdNotLoadedYet() + + **func** onUserEarnedReward(type: String, amount: Int) + + **func** onComplete() + + **func** onError(code: Int, message: String) + + **func** onWarning(code: Int, message: String) From 4cdaa5e4aab911d6d854733cad78a4e9a7ee57ff Mon Sep 17 00:00:00 2001 From: rishh18 Date: Thu, 9 Jan 2025 12:58:57 +0530 Subject: [PATCH 2/4] package file updated --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index a1754d3..377683f 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,7 @@ let package = Package( targets: [ .binaryTarget( name: "ApMobileSDK", - url: "https://github.com/adpushup/ApiOSSDK/releases/tag/1.0.0/ApMobileSDK.xcframework.zip", + url: "https://github.com/adpushup/ApiOSSDK/releases/tag/v1.0.0/ApMobileSDK.xcframework.zip", dependencies: [.product(name: "GoogleMobileAds", package: "swift-package-manager-google-mobile-ads")], checksum: "e5e6c36b9b7977638bc1823680ab672c" ) From 3c27637fb6fd1575cf4b1793b09c6ad16fc10fcc Mon Sep 17 00:00:00 2001 From: rishh18 Date: Thu, 9 Jan 2025 15:21:06 +0530 Subject: [PATCH 3/4] podspec change --- ApMobileSDK.podspec | 6 +++--- Package.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ApMobileSDK.podspec b/ApMobileSDK.podspec index d5962a3..965db73 100644 --- a/ApMobileSDK.podspec +++ b/ApMobileSDK.podspec @@ -3,17 +3,17 @@ Pod::Spec.new do |spec| spec.name = "ApMobileSDK" - spec.version = "v1.0.0" + spec.version = "1.0.0" spec.summary = "ApMobileSDK provides full screen ad formats such as Smart Rewarded and Smart Interstitial ads for the iOS apps" spec.description = "ApMobileSDK is easy to implement SDK provides full screen ad formats such as Smart Rewarded and Smart Interstitial ads for the iOS apps it also provides in built logging functionality." spec.homepage = "https://github.com/adpushup/ApiOSSDK" spec.license = { :type => "Proprietary", :text => "LICENSE" } spec.author = { "rishh18" => "rishabh.tripathi@adpushup.com" } spec.platform = :ios, "14.0" - spec.source = { :git => "https://github.com/adpushup/ApiOSSDK.git", :tag => "v1.0.0" } + spec.source = { :git => "https://github.com/adpushup/ApiOSSDK.git", :tag => "1.0.0" } spec.swift_version = "5.0" spec.vendored_frameworks = "Sources/ApMobileSDK.xcframework" spec.dependency "Google-Mobile-Ads-SDK" spec.frameworks = "GoogleMobileAds" - + end diff --git a/Package.swift b/Package.swift index 377683f..a1754d3 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,7 @@ let package = Package( targets: [ .binaryTarget( name: "ApMobileSDK", - url: "https://github.com/adpushup/ApiOSSDK/releases/tag/v1.0.0/ApMobileSDK.xcframework.zip", + url: "https://github.com/adpushup/ApiOSSDK/releases/tag/1.0.0/ApMobileSDK.xcframework.zip", dependencies: [.product(name: "GoogleMobileAds", package: "swift-package-manager-google-mobile-ads")], checksum: "e5e6c36b9b7977638bc1823680ab672c" ) From 83bd4d7f21f5a7f4fc95327e1069f166b19d493e Mon Sep 17 00:00:00 2001 From: rishh18 Date: Thu, 9 Jan 2025 15:54:18 +0530 Subject: [PATCH 4/4] Readme changes --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 62b73fe..2c277b2 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Get the following IDs from AdPushup: -- **Ad Manager App Id**: For Android Manifest File. +- **Ad Manager App Id:** For info.plist file. - **Ap App Id**: Used in initialising Ap Mobile SDK. - **Ap Placement Ids**: Each Ad Unit has a unique placement Id. @@ -25,12 +25,12 @@ Get the following IDs from AdPushup: Update info.plist file. -- A `GADApplicationIdentifier` key with a string value of your Ad Manager app ID [found in the Ad Manager UI](https://support.google.com/admanager/answer/1656921) and of the form `ca-app-pub-################~##########`. -- A `SKAdNetworkItems` key with `SKAdNetworkIdentifier` values for Google (`cstr6suwn9.skadnetwork`) and [select third-party buyers](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/3p-skadnetworks) who have provided these values to Google. +- A `GADApplicationIdentifier` key with a string value of your **Ad Manager** app ID(Provided by Adpushup) and of the form `ca-app-pub-################~##########`. +- A `SKAdNetworkItems` key with `SKAdNetworkIdentifier` values. ```jsx GADApplicationIdentifier - ca-app-pub-3940256099942544~1458002511 + ca-app-pub-################~########## SKAdNetworkItems @@ -227,6 +227,8 @@ Import SDK in the app. ## **Initialise the Ap Mobile SDK** +Note : Replace “testId” with the App Id provided by Adpushup. + - Swift example - Add the initialise function in app delegate application function. ```swift @@ -284,6 +286,8 @@ Import SDK in the app. - Interstitial Ad - Interstitial ads are full-screen ads that cover the interface of their host app. They're typically displayed at natural transition points in the flow of an app, such as between activities or during the pause between levels in a game. When an app shows an interstitial ad, the user has the choice to either tap on the ad and continue to its destination or close it and return to the app. + Note: Replace “testPlacement” with the Ap Placement Id provided by Adpushup. + **Implementation** - Swift example -