wowmaking / react-native-iron-source

Iron Source SDK React Native bridge
30 stars 37 forks source link

Facebook Ads not loading due to outdated SDK on iOS (And possibly on Android) #17

Closed threadhack closed 5 years ago

threadhack commented 5 years ago

Is it possible to update IronSource SDK and Mediation Adapters as well on iOS and Android? I'm getting the error from Facebook Network on IOS: The SDK version in the ad request is no longer supported for new apps. Please upgrade to one of the latest versions of the SDK On Android, it just not returns ads.

StanislavMayorov commented 5 years ago

Yes. It's possible. We will update them soon.

StanislavMayorov commented 5 years ago

Can you share your pod file? Did you try to follow official ironsrc docs? https://developers.ironsrc.com/ironsource-mobile/ios/mediation-networks-ios/#step-1 https://github.com/wowmaking/react-native-iron-source#mediation-setup

threadhack commented 5 years ago

@StanislavMayorov my pod file currently has RNIronSource dependency like in docs: pod 'RNIronSource', :path => '../node_modules/@wowmaking/react-native-iron-source', :subspecs => [ 'Core', # required 'AdColony', 'Admob', 'Amazon', 'AppLovin', 'Chartboost', 'Facebook', 'HyprMX', 'InMobi', 'Maio', 'MediaBrix', 'Tapjoy', 'UnityAds', 'Vungle' ]

I tried to add the latest adapter pod 'IronSourceFacebookAdapter','4.3.4.2' separately instead of using it from podspec but pod install throws the following error:

[!] CocoaPods could not find compatible versions for pod "IronSourceSDK":
  In Podfile:
    IronSourceFacebookAdapter (= 4.3.4.2) was resolved to 4.3.4.2, which depends on
      IronSourceSDK (= 6.8.4.0)

    RNIronSource/InMobi (from "../node_modules/@wowmaking/react-native-iron-source") was resolved to 2.8.4, which depends on
      IronSourceSDK (= 6.8.3.0)

So, it seems that IronSource dependency needs to be updated as well.

StanislavMayorov commented 5 years ago

You are right. Looks like a problem for ios.

On Android, it just not returns ads.

Did you add mediation in your project gradle?

threadhack commented 5 years ago

@StanislavMayorov I have added facebook mediation adapter to Gradle, This is my project build.gradle dependency section:

    implementation project(':@wowmaking_react-native-iron-source')
    implementation project(':react-native-fbsdk')
    implementation project(':react-native-sound')
    implementation project(':react-native-firebase')
    implementation project(':react-native-code-push')
    implementation project(':react-native-gesture-handler')
    implementation project(':react-native-vector-icons')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules

    //firebase
    implementation "com.google.android.gms:play-services-base:16.1.0"
    implementation "com.google.firebase:firebase-core:16.0.8"
    implementation "com.google.firebase:firebase-ads:15.0.1"

    //Iron Source mediation
    //Chartboost
    implementation 'com.ironsource.adapters:chartboostadapter:4.1.8@jar'
    //Admob
    implementation 'com.ironsource.adapters:admobadapter:4.3.3@jar'
    implementation 'com.google.android.gms:play-services-ads:17.2.0'
    //Facebook
    implementation 'com.ironsource.adapters:facebookadapter:4.3.3@jar'
    implementation 'com.facebook.android:audience-network-sdk:5.3.2'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    //Unity
    implementation 'com.ironsource.adapters:unityadsadapter:4.1.4@jar'
    //Vungle
    implementation 'com.ironsource.adapters:vungleadapter:4.1.5@jar'
    implementation 'com.github.vungle:vungle-android-sdk:6.3.24'

I have already added a few networks (Unity, Vungle, AdMob, Chartboos) and it works as expected. The problem so far with Facebook mediation on Android and IOS.

Integration helper output:

I/IntegrationHelper: --------------- Facebook --------------
I/IntegrationHelper: Adapter 4.3.3 - VERIFIED
I/IntegrationHelper: Adapter - VERIFIED
I/IntegrationHelper: SDK Version - 5.3.1
I/IntegrationHelper: *** Activities ***
I/IntegrationHelper: com.facebook.ads.AudienceNetworkActivity - VERIFIED
I/IntegrationHelper: com.facebook.ads.internal.ipc.RemoteANActivity - VERIFIED
I/IntegrationHelper: *** Services ***
I/IntegrationHelper: com.facebook.ads.internal.ipc.AdsProcessPriorityService - VERIFIED
I/IntegrationHelper: com.facebook.ads.internal.ipc.AdsMessengerService - VERIFIED
I/IntegrationHelper: >>>> Facebook - VERIFIED

When I try to load interstitial ad it returns:

I/ADAPTER_API: Facebook:loadInterstitial()
I/ADAPTER_API: Facebook loadInterstitial <326936938260645_326951401592532>
E/ActivityThread: Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider
I/INTERNAL: Interstitial Ad <326936938260645_326951401592532>  onError: No fill
I/ADAPTER_CALLBACK: Facebook:onInterstitialAdLoadFailed(errorCode:1001, errorMessage:No fill)
I/CALLBACK: onInterstitialAdLoadFailed(errorCode:509, errorMessage:No ads to show)
StanislavMayorov commented 5 years ago

I will try to remove ironsrc SDK dependency from pod so users can use any version of SDK on ios. Just like it works on android.

Where is implementation 'com.ironsource.sdk:mediationsdk:6.8.5@jar' in your gradle? Your error says that there's no ads for your test device. It's okay. Can you try another device? Did you add this device to irosrc test devices?

onInterstitialAdLoadFailed(errorCode:509, errorMessage:No ads to show)

threadhack commented 5 years ago

@StanislavMayorov I have added test devices in IronSource.

I added implementation 'com.ironsource.sdk:mediationsdk:6.8.5@jar' to my Gradle, but it doesn't help. (I think it used mediation SDK 6.8.2 from RNIronSource, but it was a good point to upgrade to 6.8.5)

After some debugging I executed this code manually in debugger before facebook SDK initialized: AdSettings.addTestDevice("4b61cf06-707e-4a7c-998d-ac59a730e2a9"); AdSettings - this is the class from Facebook SDK, uuid - my device id And then facebook finally started returning ads.
So I think the problem may be with test device handling in Facebook IronSource adapter - it may not passing test device id to facebook SDK.

As for iOS it is still not returning ads and says that SDK is outdated.

StanislavMayorov commented 5 years ago

As for iOS it is still not returning ads and says that SDK is outdated.

Yes, It is outdated. if you need temparary workaround you can create a fork and update this line. https://github.com/wowmaking/react-native-iron-source/blob/master/RNIronSource.podspec#L20

StanislavMayorov commented 5 years ago

Released in 3.0.0.