@bigcrunch/react-native-ads 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/bigcrunch-ads/com/bigcrunch/ads/BigCrunchAds.kt +7 -4
- package/android/bigcrunch-ads/com/bigcrunch/ads/adapters/GoogleAdsAdapter.kt +8 -1
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/AdOrchestrator.kt +37 -12
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/AnalyticsClient.kt +199 -40
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/BidRequestClient.kt +52 -17
- package/android/bigcrunch-ads/com/bigcrunch/ads/core/DeviceContext.kt +1 -1
- package/android/bigcrunch-ads/com/bigcrunch/ads/models/AdEvent.kt +81 -2
- package/android/bigcrunch-ads/com/bigcrunch/ads/models/PlacementConfig.kt +4 -1
- package/android/src/main/java/com/bigcrunch/ads/react/BigCrunchAdsModule.kt +44 -2
- package/ios/BigCrunchAds/Sources/Adapters/GoogleAdsAdapter.swift +7 -0
- package/ios/BigCrunchAds/Sources/BigCrunchAds.swift +10 -6
- package/ios/BigCrunchAds/Sources/BigCrunchRewarded.swift +10 -2
- package/ios/BigCrunchAds/Sources/Core/AdOrchestrator.swift +20 -4
- package/ios/BigCrunchAds/Sources/Core/AnalyticsClient.swift +179 -77
- package/ios/BigCrunchAds/Sources/Core/BidRequestClient.swift +54 -17
- package/ios/BigCrunchAds/Sources/Core/DeviceContext.swift +1 -1
- package/ios/BigCrunchAds/Sources/Models/AdEvent.swift +111 -3
- package/ios/BigCrunchAds/Sources/Models/PlacementConfig.swift +4 -1
- package/ios/BigCrunchAdsModule.m +1 -0
- package/ios/BigCrunchAdsModule.swift +29 -2
- package/ios/BigCrunchBannerViewManager.swift +1 -0
- package/lib/BigCrunchAds.d.ts +19 -2
- package/lib/BigCrunchAds.d.ts.map +1 -1
- package/lib/BigCrunchAds.js +19 -2
- package/lib/NativeBigCrunchAds.d.ts +2 -2
- package/lib/NativeBigCrunchAds.d.ts.map +1 -1
- package/lib/types/index.d.ts +36 -0
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/react-native-bigcrunch-ads.podspec +1 -1
- package/src/BigCrunchAds.ts +23 -2
- package/src/NativeBigCrunchAds.ts +2 -2
- package/src/types/index.ts +38 -0
|
@@ -38,6 +38,95 @@ internal struct RevenueData: Codable {
|
|
|
38
38
|
let currency: String
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// MARK: - Screen View Options
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Options for customizing screen view tracking
|
|
45
|
+
*
|
|
46
|
+
* Allows app developers to provide page URL, content metadata,
|
|
47
|
+
* and custom dimensions for analytics events.
|
|
48
|
+
*/
|
|
49
|
+
public struct ScreenViewOptions {
|
|
50
|
+
/// Override the auto-generated page URL (must be a valid URL)
|
|
51
|
+
public var pageUrl: String?
|
|
52
|
+
|
|
53
|
+
/// Content metadata for this screen/page
|
|
54
|
+
public var pageMeta: PageMetaData?
|
|
55
|
+
|
|
56
|
+
/// Custom key-value dimensions attached to analytics events
|
|
57
|
+
public var customDimensions: [String: String]?
|
|
58
|
+
|
|
59
|
+
public init(
|
|
60
|
+
pageUrl: String? = nil,
|
|
61
|
+
pageMeta: PageMetaData? = nil,
|
|
62
|
+
customDimensions: [String: String]? = nil
|
|
63
|
+
) {
|
|
64
|
+
self.pageUrl = pageUrl
|
|
65
|
+
self.pageMeta = pageMeta
|
|
66
|
+
self.customDimensions = customDimensions
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Content metadata for a screen/page view
|
|
72
|
+
*
|
|
73
|
+
* Matches the `page_meta_data` fields in the analytics schema.
|
|
74
|
+
*/
|
|
75
|
+
public struct PageMetaData: Codable {
|
|
76
|
+
/// Canonical page URL
|
|
77
|
+
public var url: String?
|
|
78
|
+
/// Content author
|
|
79
|
+
public var author: String?
|
|
80
|
+
/// Page/screen title
|
|
81
|
+
public var title: String?
|
|
82
|
+
/// Featured image URL
|
|
83
|
+
public var thumbnailUrl: String?
|
|
84
|
+
/// Content section/category
|
|
85
|
+
public var articleSection: String?
|
|
86
|
+
/// Comma-separated keywords
|
|
87
|
+
public var keywords: String?
|
|
88
|
+
/// Content creation date (ISO 8601)
|
|
89
|
+
public var dateCreated: String?
|
|
90
|
+
/// Content last modified date (ISO 8601)
|
|
91
|
+
public var dateModified: String?
|
|
92
|
+
/// Content publication date (ISO 8601)
|
|
93
|
+
public var datePublished: String?
|
|
94
|
+
|
|
95
|
+
public init(
|
|
96
|
+
url: String? = nil,
|
|
97
|
+
author: String? = nil,
|
|
98
|
+
title: String? = nil,
|
|
99
|
+
thumbnailUrl: String? = nil,
|
|
100
|
+
articleSection: String? = nil,
|
|
101
|
+
keywords: String? = nil,
|
|
102
|
+
dateCreated: String? = nil,
|
|
103
|
+
dateModified: String? = nil,
|
|
104
|
+
datePublished: String? = nil
|
|
105
|
+
) {
|
|
106
|
+
self.url = url
|
|
107
|
+
self.author = author
|
|
108
|
+
self.title = title
|
|
109
|
+
self.thumbnailUrl = thumbnailUrl
|
|
110
|
+
self.articleSection = articleSection
|
|
111
|
+
self.keywords = keywords
|
|
112
|
+
self.dateCreated = dateCreated
|
|
113
|
+
self.dateModified = dateModified
|
|
114
|
+
self.datePublished = datePublished
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
enum CodingKeys: String, CodingKey {
|
|
118
|
+
case url
|
|
119
|
+
case author
|
|
120
|
+
case title
|
|
121
|
+
case thumbnailUrl = "thumbnailUrl"
|
|
122
|
+
case articleSection = "articleSection"
|
|
123
|
+
case keywords
|
|
124
|
+
case dateCreated = "dateCreated"
|
|
125
|
+
case dateModified = "dateModified"
|
|
126
|
+
case datePublished = "datePublished"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
41
130
|
// MARK: - Enhanced Analytics Events (matching web SDK data model)
|
|
42
131
|
|
|
43
132
|
/**
|
|
@@ -91,6 +180,9 @@ internal struct PageViewEvent: Codable {
|
|
|
91
180
|
let amznPubId: String // Must be valid UUID (nil UUID for empty)
|
|
92
181
|
let customDimensions: [String: String]
|
|
93
182
|
|
|
183
|
+
// Page metadata (only for pageview events)
|
|
184
|
+
let pageMetaData: PageMetaData?
|
|
185
|
+
|
|
94
186
|
enum CodingKeys: String, CodingKey {
|
|
95
187
|
case payloadVersion = "payload_version"
|
|
96
188
|
case configVersion = "config_version"
|
|
@@ -123,6 +215,7 @@ internal struct PageViewEvent: Codable {
|
|
|
123
215
|
case gamNetworkCode = "gam_network_code"
|
|
124
216
|
case amznPubId = "amzn_pub_id"
|
|
125
217
|
case customDimensions = "custom_dimensions"
|
|
218
|
+
case pageMetaData = "page_meta_data"
|
|
126
219
|
}
|
|
127
220
|
}
|
|
128
221
|
|
|
@@ -269,7 +362,7 @@ internal struct ImpressionBatchEvent: Codable {
|
|
|
269
362
|
let customDimensions: [String: String]
|
|
270
363
|
|
|
271
364
|
// Nested impressions array
|
|
272
|
-
|
|
365
|
+
var impressions: [ImpressionRecord]
|
|
273
366
|
|
|
274
367
|
enum CodingKeys: String, CodingKey {
|
|
275
368
|
case payloadVersion = "payload_version"
|
|
@@ -577,7 +670,7 @@ internal struct ViewabilityEvent: Codable {
|
|
|
577
670
|
let amznPubId: String
|
|
578
671
|
|
|
579
672
|
// Nested viewability array (per backend schema)
|
|
580
|
-
|
|
673
|
+
var viewability: [ViewabilityData]
|
|
581
674
|
|
|
582
675
|
enum CodingKeys: String, CodingKey {
|
|
583
676
|
case payloadVersion = "payload_version"
|
|
@@ -735,8 +828,23 @@ internal struct AuctionData {
|
|
|
735
828
|
/// Creative ID from winning bid
|
|
736
829
|
let creativeId: String?
|
|
737
830
|
|
|
831
|
+
/// GAM price bucket (hb_pb value from targeting KVPs)
|
|
832
|
+
let gamPriceBucket: String?
|
|
833
|
+
|
|
834
|
+
/// Floor price sent to bidders
|
|
835
|
+
let floorPrice: Double?
|
|
836
|
+
|
|
837
|
+
/// Second-highest bid price (for computing min_bid_to_win)
|
|
838
|
+
let secondHighestBid: Double?
|
|
839
|
+
|
|
840
|
+
/// Demand channel ("S2S", "Google Ad Exchange", etc.)
|
|
841
|
+
let demandChannel: String?
|
|
842
|
+
|
|
738
843
|
/// Empty auction data
|
|
739
|
-
static let empty = AuctionData(
|
|
844
|
+
static let empty = AuctionData(
|
|
845
|
+
auctionId: nil, bidder: nil, bidPriceCpm: nil, creativeId: nil,
|
|
846
|
+
gamPriceBucket: nil, floorPrice: nil, secondHighestBid: nil, demandChannel: nil
|
|
847
|
+
)
|
|
740
848
|
}
|
|
741
849
|
|
|
742
850
|
// MARK: - Impression Context
|
|
@@ -13,19 +13,22 @@ public struct PlacementConfig: Codable {
|
|
|
13
13
|
public let gamAdUnit: String
|
|
14
14
|
public let sizes: [AdSize]?
|
|
15
15
|
public let refresh: RefreshConfig?
|
|
16
|
+
public let floorPrice: Double?
|
|
16
17
|
|
|
17
18
|
public init(
|
|
18
19
|
placementId: String,
|
|
19
20
|
format: String,
|
|
20
21
|
gamAdUnit: String,
|
|
21
22
|
sizes: [AdSize]?,
|
|
22
|
-
refresh: RefreshConfig? = nil
|
|
23
|
+
refresh: RefreshConfig? = nil,
|
|
24
|
+
floorPrice: Double? = nil
|
|
23
25
|
) {
|
|
24
26
|
self.placementId = placementId
|
|
25
27
|
self.format = format
|
|
26
28
|
self.gamAdUnit = gamAdUnit
|
|
27
29
|
self.sizes = sizes
|
|
28
30
|
self.refresh = refresh
|
|
31
|
+
self.floorPrice = floorPrice
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
|
package/ios/BigCrunchAdsModule.m
CHANGED
|
@@ -20,6 +20,7 @@ RCT_EXTERN_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve
|
|
|
20
20
|
|
|
21
21
|
// Screen Tracking
|
|
22
22
|
RCT_EXTERN_METHOD(trackScreenView:(NSString *)screenName
|
|
23
|
+
options:(NSDictionary *)options
|
|
23
24
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
24
25
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
25
26
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Foundation
|
|
2
|
+
import BigCrunchAds
|
|
2
3
|
#if canImport(React)
|
|
3
4
|
import React
|
|
4
5
|
#endif
|
|
@@ -278,12 +279,38 @@ class BigCrunchAdsModule: RCTEventEmitter {
|
|
|
278
279
|
|
|
279
280
|
// MARK: - Screen Tracking
|
|
280
281
|
|
|
281
|
-
@objc(trackScreenView:resolver:rejecter:)
|
|
282
|
+
@objc(trackScreenView:options:resolver:rejecter:)
|
|
282
283
|
func trackScreenView(screenName: String,
|
|
284
|
+
options: NSDictionary?,
|
|
283
285
|
resolver: @escaping RCTPromiseResolveBlock,
|
|
284
286
|
rejecter: @escaping RCTPromiseRejectBlock) {
|
|
285
287
|
DispatchQueue.main.async {
|
|
286
|
-
|
|
288
|
+
var screenViewOptions: ScreenViewOptions? = nil
|
|
289
|
+
|
|
290
|
+
if let opts = options as? [String: Any] {
|
|
291
|
+
var pageMeta: PageMetaData? = nil
|
|
292
|
+
if let metaDict = opts["pageMeta"] as? [String: String] {
|
|
293
|
+
pageMeta = PageMetaData(
|
|
294
|
+
url: metaDict["url"],
|
|
295
|
+
author: metaDict["author"],
|
|
296
|
+
title: metaDict["title"],
|
|
297
|
+
thumbnailUrl: metaDict["thumbnailUrl"],
|
|
298
|
+
articleSection: metaDict["articleSection"],
|
|
299
|
+
keywords: metaDict["keywords"],
|
|
300
|
+
dateCreated: metaDict["dateCreated"],
|
|
301
|
+
dateModified: metaDict["dateModified"],
|
|
302
|
+
datePublished: metaDict["datePublished"]
|
|
303
|
+
)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
screenViewOptions = ScreenViewOptions(
|
|
307
|
+
pageUrl: opts["pageUrl"] as? String,
|
|
308
|
+
pageMeta: pageMeta,
|
|
309
|
+
customDimensions: opts["customDimensions"] as? [String: String]
|
|
310
|
+
)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
BigCrunchAds.trackScreen(screenName, options: screenViewOptions)
|
|
287
314
|
resolver(nil)
|
|
288
315
|
}
|
|
289
316
|
}
|
package/lib/BigCrunchAds.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* BigCrunch Mobile Ads SDK for React Native
|
|
3
3
|
* Main API class
|
|
4
4
|
*/
|
|
5
|
-
import type { InitializationOptions, Environment, SessionInfo, DeviceContext, AppConfig, EventSubscription } from './types';
|
|
5
|
+
import type { InitializationOptions, Environment, SessionInfo, DeviceContext, AppConfig, EventSubscription, ScreenViewOptions } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* Main entry point for BigCrunch Mobile Ads SDK
|
|
8
8
|
*/
|
|
@@ -34,13 +34,30 @@ export declare class BigCrunchAds {
|
|
|
34
34
|
* Track a screen view for analytics
|
|
35
35
|
*
|
|
36
36
|
* @param screenName - Name of the screen being viewed
|
|
37
|
+
* @param options - Optional overrides for page URL, content metadata, and custom dimensions
|
|
37
38
|
*
|
|
38
39
|
* @example
|
|
39
40
|
* ```typescript
|
|
41
|
+
* // Simple usage
|
|
40
42
|
* BigCrunchAds.trackScreenView('HomeScreen');
|
|
43
|
+
*
|
|
44
|
+
* // With options
|
|
45
|
+
* BigCrunchAds.trackScreenView('ArticlePage', {
|
|
46
|
+
* pageUrl: 'https://example.com/articles/123',
|
|
47
|
+
* pageMeta: {
|
|
48
|
+
* title: 'My Article Title',
|
|
49
|
+
* author: 'Jane Smith',
|
|
50
|
+
* articleSection: 'Technology',
|
|
51
|
+
* keywords: 'tech,mobile,apps',
|
|
52
|
+
* },
|
|
53
|
+
* customDimensions: {
|
|
54
|
+
* content_type: 'article',
|
|
55
|
+
* content_id: '123',
|
|
56
|
+
* },
|
|
57
|
+
* });
|
|
41
58
|
* ```
|
|
42
59
|
*/
|
|
43
|
-
static trackScreenView(screenName: string): Promise<void>;
|
|
60
|
+
static trackScreenView(screenName: string, options?: ScreenViewOptions): Promise<void>;
|
|
44
61
|
/**
|
|
45
62
|
* Get the current app configuration
|
|
46
63
|
* Returns null if config hasn't been loaded yet
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BigCrunchAds.d.ts","sourceRoot":"","sources":["../src/BigCrunchAds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,EACT,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;IACzC,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAA8B;IAElE;;;;;;;;;;;;;;;OAeG;WACU,UAAU,CACrB,UAAU,EAAE,MAAM,EAClB,WAAW,GAAE,WAA0B,EACvC,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC;IA0BhB;;OAEG;WACU,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAO9C
|
|
1
|
+
{"version":3,"file":"BigCrunchAds.d.ts","sourceRoot":"","sources":["../src/BigCrunchAds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;IACzC,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAA8B;IAElE;;;;;;;;;;;;;;;OAeG;WACU,UAAU,CACrB,UAAU,EAAE,MAAM,EAClB,WAAW,GAAE,WAA0B,EACvC,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC;IA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AAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjB;;OAEG;WACU,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhD;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CACrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAC7B,iBAAiB;IAOpB;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,GAAG,iBAAiB;IAIhF;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,iBAAiB;IAI1E;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,iBAAiB;IAIpF;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,iBAAiB;IAIlF;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;CAOjC;AAGD,eAAe,YAAY,CAAC"}
|
package/lib/BigCrunchAds.js
CHANGED
|
@@ -60,15 +60,32 @@ export class BigCrunchAds {
|
|
|
60
60
|
* Track a screen view for analytics
|
|
61
61
|
*
|
|
62
62
|
* @param screenName - Name of the screen being viewed
|
|
63
|
+
* @param options - Optional overrides for page URL, content metadata, and custom dimensions
|
|
63
64
|
*
|
|
64
65
|
* @example
|
|
65
66
|
* ```typescript
|
|
67
|
+
* // Simple usage
|
|
66
68
|
* BigCrunchAds.trackScreenView('HomeScreen');
|
|
69
|
+
*
|
|
70
|
+
* // With options
|
|
71
|
+
* BigCrunchAds.trackScreenView('ArticlePage', {
|
|
72
|
+
* pageUrl: 'https://example.com/articles/123',
|
|
73
|
+
* pageMeta: {
|
|
74
|
+
* title: 'My Article Title',
|
|
75
|
+
* author: 'Jane Smith',
|
|
76
|
+
* articleSection: 'Technology',
|
|
77
|
+
* keywords: 'tech,mobile,apps',
|
|
78
|
+
* },
|
|
79
|
+
* customDimensions: {
|
|
80
|
+
* content_type: 'article',
|
|
81
|
+
* content_id: '123',
|
|
82
|
+
* },
|
|
83
|
+
* });
|
|
67
84
|
* ```
|
|
68
85
|
*/
|
|
69
|
-
static async trackScreenView(screenName) {
|
|
86
|
+
static async trackScreenView(screenName, options) {
|
|
70
87
|
this.ensureInitialized();
|
|
71
|
-
return NativeBigCrunchAds.trackScreenView(screenName);
|
|
88
|
+
return NativeBigCrunchAds.trackScreenView(screenName, options);
|
|
72
89
|
}
|
|
73
90
|
/**
|
|
74
91
|
* Get the current app configuration
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* This is the bridge to the native Android/iOS implementation
|
|
4
4
|
*/
|
|
5
5
|
import { NativeEventEmitter } from 'react-native';
|
|
6
|
-
import type { InitializationOptions, AdRequestOptions, SessionInfo, DeviceContext, AppConfig } from './types';
|
|
6
|
+
import type { InitializationOptions, AdRequestOptions, SessionInfo, DeviceContext, AppConfig, ScreenViewOptions } from './types';
|
|
7
7
|
export interface NativeBigCrunchAdsModule {
|
|
8
8
|
initialize(options: InitializationOptions): Promise<void>;
|
|
9
9
|
isInitialized(): Promise<boolean>;
|
|
10
10
|
getAppConfig(): Promise<AppConfig | null>;
|
|
11
11
|
refreshConfig(): Promise<void>;
|
|
12
|
-
trackScreenView(screenName: string): Promise<void>;
|
|
12
|
+
trackScreenView(screenName: string, options?: ScreenViewOptions): Promise<void>;
|
|
13
13
|
loadInterstitial(options: AdRequestOptions): Promise<void>;
|
|
14
14
|
showInterstitial(placementId: string): Promise<void>;
|
|
15
15
|
isInterstitialLoaded(placementId: string): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeBigCrunchAds.d.ts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kBAAkB,EAAyB,wBAAwB,CAAC;AAGjF,eAAO,MAAM,wBAAwB,oBAA6C,CAAC;AAGnF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCnB,CAAC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -43,6 +43,42 @@ export interface InitializationOptions {
|
|
|
43
43
|
/** Session timeout in seconds (default: 1800) */
|
|
44
44
|
sessionTimeout?: number;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Content metadata for a screen/page view
|
|
48
|
+
*
|
|
49
|
+
* Matches the `page_meta_data` fields in the BigCrunch analytics schema.
|
|
50
|
+
*/
|
|
51
|
+
export interface PageMetaData {
|
|
52
|
+
/** Canonical page URL */
|
|
53
|
+
url?: string;
|
|
54
|
+
/** Content author */
|
|
55
|
+
author?: string;
|
|
56
|
+
/** Page/screen title */
|
|
57
|
+
title?: string;
|
|
58
|
+
/** Featured image URL */
|
|
59
|
+
thumbnailUrl?: string;
|
|
60
|
+
/** Content section/category */
|
|
61
|
+
articleSection?: string;
|
|
62
|
+
/** Comma-separated keywords */
|
|
63
|
+
keywords?: string;
|
|
64
|
+
/** Content creation date (ISO 8601) */
|
|
65
|
+
dateCreated?: string;
|
|
66
|
+
/** Content last modified date (ISO 8601) */
|
|
67
|
+
dateModified?: string;
|
|
68
|
+
/** Content publication date (ISO 8601) */
|
|
69
|
+
datePublished?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Options for customizing screen view tracking
|
|
73
|
+
*/
|
|
74
|
+
export interface ScreenViewOptions {
|
|
75
|
+
/** Override the auto-generated page URL (must be a valid web URL) */
|
|
76
|
+
pageUrl?: string;
|
|
77
|
+
/** Content metadata for this screen/page */
|
|
78
|
+
pageMeta?: PageMetaData;
|
|
79
|
+
/** Custom key-value dimensions attached to analytics events */
|
|
80
|
+
customDimensions?: Record<string, string>;
|
|
81
|
+
}
|
|
46
82
|
/**
|
|
47
83
|
* Ad request options
|
|
48
84
|
*/
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,SAAS,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,UAAU,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,cAAc,GACd,kBAAkB,GAClB,aAAa,GACb,aAAa,GACb,UAAU,GACV,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;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IACtB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9D,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigcrunch/react-native-ads",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "BigCrunch Mobile Ads SDK for React Native - Simplified in-app advertising with S2S demand and Google Ad Manager",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -92,4 +92,4 @@
|
|
|
92
92
|
"optional": false
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
}
|
|
95
|
+
}
|
package/src/BigCrunchAds.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
DeviceContext,
|
|
16
16
|
AppConfig,
|
|
17
17
|
EventSubscription,
|
|
18
|
+
ScreenViewOptions,
|
|
18
19
|
} from './types';
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -84,15 +85,35 @@ export class BigCrunchAds {
|
|
|
84
85
|
* Track a screen view for analytics
|
|
85
86
|
*
|
|
86
87
|
* @param screenName - Name of the screen being viewed
|
|
88
|
+
* @param options - Optional overrides for page URL, content metadata, and custom dimensions
|
|
87
89
|
*
|
|
88
90
|
* @example
|
|
89
91
|
* ```typescript
|
|
92
|
+
* // Simple usage
|
|
90
93
|
* BigCrunchAds.trackScreenView('HomeScreen');
|
|
94
|
+
*
|
|
95
|
+
* // With options
|
|
96
|
+
* BigCrunchAds.trackScreenView('ArticlePage', {
|
|
97
|
+
* pageUrl: 'https://example.com/articles/123',
|
|
98
|
+
* pageMeta: {
|
|
99
|
+
* title: 'My Article Title',
|
|
100
|
+
* author: 'Jane Smith',
|
|
101
|
+
* articleSection: 'Technology',
|
|
102
|
+
* keywords: 'tech,mobile,apps',
|
|
103
|
+
* },
|
|
104
|
+
* customDimensions: {
|
|
105
|
+
* content_type: 'article',
|
|
106
|
+
* content_id: '123',
|
|
107
|
+
* },
|
|
108
|
+
* });
|
|
91
109
|
* ```
|
|
92
110
|
*/
|
|
93
|
-
static async trackScreenView(
|
|
111
|
+
static async trackScreenView(
|
|
112
|
+
screenName: string,
|
|
113
|
+
options?: ScreenViewOptions
|
|
114
|
+
): Promise<void> {
|
|
94
115
|
this.ensureInitialized();
|
|
95
|
-
return NativeBigCrunchAds.trackScreenView(screenName);
|
|
116
|
+
return NativeBigCrunchAds.trackScreenView(screenName, options);
|
|
96
117
|
}
|
|
97
118
|
|
|
98
119
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { NativeModules, NativeEventEmitter, Platform } from 'react-native';
|
|
7
|
-
import type { InitializationOptions, AdRequestOptions, SessionInfo, DeviceContext, AppConfig } from './types';
|
|
7
|
+
import type { InitializationOptions, AdRequestOptions, SessionInfo, DeviceContext, AppConfig, ScreenViewOptions } from './types';
|
|
8
8
|
|
|
9
9
|
// Type definition for the native module
|
|
10
10
|
export interface NativeBigCrunchAdsModule {
|
|
@@ -17,7 +17,7 @@ export interface NativeBigCrunchAdsModule {
|
|
|
17
17
|
refreshConfig(): Promise<void>;
|
|
18
18
|
|
|
19
19
|
// Screen tracking
|
|
20
|
-
trackScreenView(screenName: string): Promise<void>;
|
|
20
|
+
trackScreenView(screenName: string, options?: ScreenViewOptions): Promise<void>;
|
|
21
21
|
|
|
22
22
|
// Interstitial ads
|
|
23
23
|
loadInterstitial(options: AdRequestOptions): Promise<void>;
|
package/src/types/index.ts
CHANGED
|
@@ -57,6 +57,44 @@ export interface InitializationOptions {
|
|
|
57
57
|
sessionTimeout?: number;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Content metadata for a screen/page view
|
|
62
|
+
*
|
|
63
|
+
* Matches the `page_meta_data` fields in the BigCrunch analytics schema.
|
|
64
|
+
*/
|
|
65
|
+
export interface PageMetaData {
|
|
66
|
+
/** Canonical page URL */
|
|
67
|
+
url?: string;
|
|
68
|
+
/** Content author */
|
|
69
|
+
author?: string;
|
|
70
|
+
/** Page/screen title */
|
|
71
|
+
title?: string;
|
|
72
|
+
/** Featured image URL */
|
|
73
|
+
thumbnailUrl?: string;
|
|
74
|
+
/** Content section/category */
|
|
75
|
+
articleSection?: string;
|
|
76
|
+
/** Comma-separated keywords */
|
|
77
|
+
keywords?: string;
|
|
78
|
+
/** Content creation date (ISO 8601) */
|
|
79
|
+
dateCreated?: string;
|
|
80
|
+
/** Content last modified date (ISO 8601) */
|
|
81
|
+
dateModified?: string;
|
|
82
|
+
/** Content publication date (ISO 8601) */
|
|
83
|
+
datePublished?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Options for customizing screen view tracking
|
|
88
|
+
*/
|
|
89
|
+
export interface ScreenViewOptions {
|
|
90
|
+
/** Override the auto-generated page URL (must be a valid web URL) */
|
|
91
|
+
pageUrl?: string;
|
|
92
|
+
/** Content metadata for this screen/page */
|
|
93
|
+
pageMeta?: PageMetaData;
|
|
94
|
+
/** Custom key-value dimensions attached to analytics events */
|
|
95
|
+
customDimensions?: Record<string, string>;
|
|
96
|
+
}
|
|
97
|
+
|
|
60
98
|
/**
|
|
61
99
|
* Ad request options
|
|
62
100
|
*/
|