Comment on page
Ad Support
- Firework React Native SDK is already integrated into your app.
- Contact our business team you are coordinating with and ensure your Firework account has ads functionality enabled.
Add the following codes in the
Podfile
of your iOS project.pod 'FireworkVideoGAMSupport'
FireworkVideoGAMSupport
depends on Google-Mobile-Ads-SDK
.- 1.
- 2.Ensure compliance with user consent policies by reviewing the Google User Messaging Platform (UMP) Get Started guide.
In your iOS project, you need to call
FireworkVideoGAMSupportSDK.initializeSDK()
in application(:, didFinishLaunchingWithOptions:) -> Bool
method.import FireworkVideoGAMSupport
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FireworkVideoGAMSupportSDK.initializeSDK()
return true
}
If your
AppDelegate
class is written by Objective-C, you should create a Swift file to call the API. For example, you could create FireworkSupportLibraryBridge.swift
and add the following codes.import Foundation
import FireworkVideoGAMSupport
@objc
public class FireworkSupportLibraryBridge: NSObject {
@objc public static func enableVideoGAM() {
FireworkVideoGAMSupportSDK.initializeSDK()
}
}
Then add
[FireworkSupportLibraryBridge enableVideoGAM];
on application:didFinishLaunchingWithOptions:
method.// You should change the file to Objective-C Generated Interface Header name.
// Generally, it's "{TargetName}-Swift.h"
#import "FireworkSdkExample-Swift.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FireworkSupportLibraryBridge enableVideoGAM];
return YES;
}
You should use the Google User Messaging Platform to obtain user consent if required for your geography. To customize the setup of the SDK until after user consent is obtained, call
FireworkVideoGAMSupportSDK.initializeSDK
with startGADMobileAds
set to false.import FireworkVideoGAMSupport
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FireworkVideoGAMSupportSDK.initializeSDK(startGADMobileAds: false)
return true
}
If your
AppDelegate
class is written by Objective-C, you should create a Swift file to call the API. For example, you could create FireworkSupportLibraryBridge.swift
and add the following codes.import Foundation
import FireworkVideoGAMSupport
@objc
public class FireworkSupportLibraryBridge: NSObject {
@objc public static func enableVideoGAM() {
FireworkVideoGAMSupportSDK.initializeSDK(startGADMobileAds: false)
}
}
Then add
[FireworkSupportLibraryBridge enableVideoGAM];
on application:didFinishLaunchingWithOptions:
method.// You should change the file to Objective-C Generated Interface Header name.
// Generally, it's "{TargetName}-Swift.h"
#import "FireworkSdkExample-Swift.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FireworkSupportLibraryBridge enableVideoGAM];
return YES;
}
- 1.Please refer to the Mobile Ads SDK (Android) to add your
AdMob app ID
to your app's AndroidManifest.xml file. - 2.Ensure compliance with user consent policies by reviewing the Google User Messaging Platform (UMP) Get Started guide.
Add the following codes in the
Podfile
of your iOS project.pod 'FireworkVideoGIMASupport'
FireworkVideoGIMASupport
depends on GoogleAds-IMA-iOS-SDK
. For more details, please refer to IMA SDK for iOS.In your iOS project, you need to call
FireworkVideoGIMASupportSDK.enableIMAAds()
in application(:, didFinishLaunchingWithOptions:) -> Bool
method.import FireworkVideoGIMASupport
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// We should put FireworkVideoGIMASupportSDK.enableIMAAds()
// inside the block of DispatchQueue.main.async.
DispatchQueue.main.async {
FireworkVideoGIMASupportSDK.enableIMAAds()
}
return true
}
If your
AppDelegate
class is written by Objective-C, you should create a Swift file to call the API. For example, you could create FireworkSupportLibraryBridge.swift
and add the following codes.import Foundation
import FireworkVideoGIMASupport
@objc
public class FireworkSupportLibraryBridge: NSObject {
@objc public static func enableVideoGIMA() {
// We should put FireworkVideoGIMASupportSDK.enableIMAAds()
// inside the block of DispatchQueue.main.async.
DispatchQueue.main.async {
FireworkVideoGIMASupportSDK.enableIMAAds()
}
}
}
Then add
[FireworkSupportLibraryBridge enableVideoGIMA];
on application:didFinishLaunchingWithOptions:
method.// You should change the file to Objective-C Generated Interface Header name.
// Generally, it's "{TargetName}-Swift.h"
#import "FireworkSdkExample-Swift.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FireworkSupportLibraryBridge enableVideoGIMA];
return YES;
}
We should put
FireworkVideoGIMASupportSDK.enableIMAAds()
inside the block of DispatchQueue.main.async
.No code configuration is required.
FireworkSDK.getInstance().setAdBadgeConfiguration({
badgeTextType: 'ad',
backgroundColor: '#ff0000',
textColor: '#000000',
});
Last modified 1mo ago