iOS Question Admob - prepare for ios14 warning email?

ilan

Expert
Licensed User
Longtime User

sorex

Expert
Licensed User
Longtime User
I also get that warning in the admob console now.

It seems like another consent pop-up to be added to our apps.

It's starting to get ridicilous and a bit like websites these days. consent for this, consent for that, newsletter pop-ups, turn off ad remover to get in...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
These are the changed required to get access to the advertiser identifier in iOS 14:

It requires Xcode 12.

Step 1:
B4X:
#AdditionalLib: AppTrackingTransparency.framework
#PlistExtra: <key>SKAdNetworkItems</key><array><dict><key>SKAdNetworkIdentifier</key><string>cstr6suwn9.skadnetwork</string></dict></array>
#PlistExtra: <key>NSUserTrackingUsageDescription</key>
#PListExtra: <string>This identifier will be used To deliver personalized ads To you.</string>

Step 2: add:
B4X:
#if OBJC
#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/AdSupport.h>
- (void)requestIDFA {
    if (@available(iOS 14, *)) {
      [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
          [self.bi raiseUIEvent:nil event:@"gad_trackingauthorization:" params:@[@(status)]];
      }];
  } else {
          [self.bi raiseUIEvent:nil event:@"gad_trackingauthorization:" params:@[@(3)]];
    }
 
}

#End If

Step 3: before loading an ad (required once):
B4X:
Dim no As NativeObject = Me
no.RunMethod("requestIDFA", Null)
Wait For GAD_TrackingAuthorization (Status As Int)
Status = 3 means that the user allowed your app access to the tracking id. Ads will be displayed even if the user denied access. You don't need to do anything with the status value.
 
Last edited:
Upvote 0

ilan

Expert
Licensed User
Longtime User
thanx erel, can i apply this update now? or should i wait?

so if i understand correctly i should call GAD_TrackingAuthorization before i call iad.loadad
should i store a file that i called this function already and dont call it again after the next start or is the status somehow stored and i dont need to do anything?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
thanx erel, can i apply this update now?
No. It can only compile with Xcode 12 which is a beta version.

so if i understand correctly i should call GAD_TrackingAuthorization before i call iad.loadad
This is an event. You should call: no.RunMethod("requestIDFA", Null)

No need to store anything. The user will be asked for the authorization once. The OS tracks it.
(There is also nothing to do with the status.)
 
Upvote 0

yiankos1

Well-Known Member
Licensed User
Longtime User
No. It can only compile with Xcode 12 which is a beta version.


This is an event. You should call: no.RunMethod("requestIDFA", Null)

No need to store anything. The user will be asked for the authorization once. The OS tracks it.
(There is also nothing to do with the status.)
Hello @Erel,
Should we wait for an update to Xcode 12(Released) in order to update our apps with App Tracking Transparency message? or it should take more time?
 
Upvote 0

yiankos1

Well-Known Member
Licensed User
Longtime User
decrease your earning
Why do you think this will happen? All users are familiar with messages at websites about "cookies" or is about irrelevant ads?
 
Upvote 0
D

Deleted member 103

Guest
These are the changed required to get access to the advertiser identifier in iOS 14:

It requires Xcode 12 and it will only be relevant in a few months from now.

Step 1:
B4X:
#AdditionalLib: AppTrackingTransparency.framework
#PlistExtra: <key>SKAdNetworkItems</key><array><dict><key>SKAdNetworkIdentifier</key><string>cstr6suwn9.skadnetwork</string></dict></array>
#PlistExtra: <key>NSUserTrackingUsageDescription</key>
#PListExtra: <string>This identifier will be used To deliver personalized ads To you.</string>

Step 2: add:
B4X:
#if OBJC
#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/AdSupport.h>
- (void)requestIDFA {
    if (@available(iOS 14, *)) {
      [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
          [self.bi raiseUIEvent:nil event:@"gad_trackingauthorization:" params:@[@(status)]];
      }];
  } else {
          [self.bi raiseUIEvent:nil event:@"gad_trackingauthorization:" params:@[@(3)]];
    }
 
}

#End If

Step 3: before loading an ad (required once):
B4X:
Dim no As NativeObject = Me
no.RunMethod("requestIDFA", Null)
Wait For GAD_TrackingAuthorization (Status As Int)
Status = 3 means that the user allowed your app access to the tracking id. Ads will be displayed even if the user denied access. You don't need to do anything with the status value.
Hi,
I have a question about this: if you implement this, is iAdmob.ConsentManager no longer necessary?
Or should it be implemented additionally?
 
Upvote 0
D

Deleted member 103

Guest
I don't think that these two features are related.
Thanks Erel!
If that's not related, then I don't understand the point.
But as is so often the case, you don't have to understand it.:rolleyes:
 
Upvote 0

yiankos1

Well-Known Member
Licensed User
Longtime User
Hi,
I have a question about this: if you implement this, is iAdmob.ConsentManager no longer necessary?
Or should it be implemented additionally?
Hello,
You need to implement both of them. This link will help you to show messages at right order.
 
Upvote 0
Top