Open JoHuang opened 5 years ago
Hi @JoHuang
Unfortunately, the C++ SDK does not currently support that feature. If it is a pressing need, I would recommend adding it with the open source build of the SDK.
I've made a pull request (#31 ) with this issue
an interesting temporary work-around this issue if you don't want to compile the libraries is to use the specific device API directly
FOR ANDROID
public void setupRewardedUserId(final String user) {
final Activity mSpawner = spawner;
this.spawner.runOnUiThread(new Runnable() {
@Override
public void run() {
RewardedVideoAd ad = MobileAds.getRewardedVideoAdInstance(mSpawner);
ad.setUserId(user);
}
});
FOR IOS
void SetRewardedUserId(std::string userId) {
dispatch_async(dispatch_get_main_queue(), ^{
GADRewardBasedVideoAd* vid = [GADRewardBasedVideoAd sharedInstance];
vid.userIdentifier = [NSString stringWithUTF8String:userId.c_str()];
});
}
This workaround will stop working against SDK 20 API, because GADRewardBasedVideoAd was deprecated and the new API does not expose a singleton instance of the RewardAd.
Hi @berinhardt,
I commented on your PR that I believe addresses this issue. Please take a look when you can.
Thanks!
I would like to setUserId
https://developers.google.com/android/reference/com/google/android/gms/ads/reward/RewardedVideoAd#setUserId(java.lang.String)
via cpp api because I would like to use SSV (server-side verification).
Is it possible via firebase-cpp-sdk? Thanks