File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -426,8 +426,6 @@ export class SegmentClient {
426
426
async process ( incomingEvent : SegmentEvent ) {
427
427
const event = this . applyRawEventData ( incomingEvent ) ;
428
428
429
- console . log ( `Process: ${ this . isReady . value } ` ) ;
430
-
431
429
if ( this . isReady . value ) {
432
430
return this . startTimelineProcessing ( event ) ;
433
431
} else {
@@ -479,9 +477,6 @@ export class SegmentClient {
479
477
* @param isReady
480
478
*/
481
479
private async onReady ( ) {
482
- console . log (
483
- `onReady, pendingEvents=${ this . store . pendingEvents . get ( ) . length } `
484
- ) ;
485
480
// Add all plugins awaiting store
486
481
if ( this . pluginsToAdd . length > 0 && ! this . isAddingPlugins ) {
487
482
this . isAddingPlugins = true ;
Original file line number Diff line number Diff line change @@ -135,7 +135,6 @@ describe('sovranStorage', () => {
135
135
136
136
it ( 'adds/removes pending events' , async ( ) => {
137
137
const sovran = new SovranStorage ( { storeId : 'test' } ) ;
138
- console . log ( sovran . pendingEvents . get ( ) ) ;
139
138
140
139
// expect(sovran.pendingEvents.get().length).toBe(0);
141
140
Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ import {
2
2
ErrorType ,
3
3
Plugin ,
4
4
PluginType ,
5
+ SegmentClient ,
5
6
SegmentError ,
6
7
} from '@segment/analytics-react-native' ;
7
8
import type { IdfaData } from './types' ;
8
9
import { AnalyticsReactNativePluginIdfa } from './AnalyticsReactNativePluginIdfa' ;
10
+ import { Platform } from 'react-native' ;
9
11
10
12
const { getTrackingAuthorizationStatus } = AnalyticsReactNativePluginIdfa ;
11
13
@@ -20,10 +22,20 @@ const { getTrackingAuthorizationStatus } = AnalyticsReactNativePluginIdfa;
20
22
export class IdfaPlugin extends Plugin {
21
23
type = PluginType . enrichment ;
22
24
25
+ private shouldAskPermission = true ;
26
+
23
27
constructor ( shouldAskPermission = true ) {
24
28
super ( ) ;
29
+ this . shouldAskPermission = shouldAskPermission ;
30
+ }
31
+
32
+ configure ( analytics : SegmentClient ) : void {
33
+ this . analytics = analytics ;
34
+ if ( Platform . OS !== 'ios' ) {
35
+ return ;
36
+ }
25
37
26
- if ( shouldAskPermission === true ) {
38
+ if ( this . shouldAskPermission === true ) {
27
39
this . getTrackingStatus ( ) ;
28
40
}
29
41
}
You can’t perform that action at this time.
0 commit comments