Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Admob Unity Package that work with Unity 3.2, 3.3, 3.4 3.5

Discussion in 'Android' started by MicroEyes_old, Mar 16, 2012.

?

Are you Satisfy with this tutorial?

  1. Yes

    71.4%
  2. No

    9.5%
  3. Not Completely

    19.0%
  1. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    thanks for sharing
     
  2. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Pleasure is completely mine. UNITY3D_TEAM
     
  3. shaanbhaya

    shaanbhaya

    Joined:
    Jul 4, 2012
    Posts:
    6
    thanks man..u r great
     
  4. chempanvee

    chempanvee

    Joined:
    Jul 23, 2012
    Posts:
    2
    Hi. I used EnableAds() method in my project, and I saw the ad showed on the screen.But I don't know why the ad content is always the same.Did the EnableAds() method refresh the ad content automaticly?
     
  5. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi chempanvee,
    Admob plugin is not controlling to refresh your advertisement. By default its 60sec. You can change this timer in your Site App setting in Admob website.

    What you can track in my plugin is, whenever my plugin receives an advertisement from Admob, onReceiveAd(Ad ad) is get called, i have added a log in it, here you can track after what time you are receiving a new advertisement. Please check your device log.

    If your are still not receiving a new advertisment after 60secs, Please check your FILL RATE in Admob website or decrease your new advertisement delay in Admob website recheck again.
     
  6. javier_durante

    javier_durante

    Joined:
    Mar 12, 2012
    Posts:
    12
    Hi MicroEyes! You saved my life with this plugin! It worked perfectly!
    Thanks a lot for sharing
     
  7. Deleted User

    Deleted User

    Guest

    MicroEyes, your plugin is really great! But I can't figure out why my friends can't click on ads. If they click anywhere on Ad - nothings happend (I suppose they should be "redirected"?). Did I miss something on AdMob.com ?
     
    Last edited by a moderator: Jul 23, 2012
  8. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    I can't get working , yesterday , the ads was showed on the screen but today no, also yesterday had ads in app and publish it in market , configure all of admob account , but it's active ,with status in red.

    Thanks for the plugin, i would like if you help me sir ^^



    Fixed! Thanks in anyway , i get it :3

    For me the problem was i have cyanogenmod 7 with ads-free and i unistall it
     
    Last edited: Jul 23, 2012
  9. chempanvee

    chempanvee

    Joined:
    Jul 23, 2012
    Posts:
    2
    Thank U very much !!!!!!!!!
     
  10. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Lerp,
    Some adv in Admob needs to click twice. I mean when you click on a advertisement, another layout on adview container comes ask you for click again to open this adv. And some advertisement do not need twice user interaction. Have tried on multiple devices?
     
  11. Deleted User

    Deleted User

    Guest

    Thank you for your answer.

    I've tried on only two devices, clicking once, twice and much more at every place on ad :(. Somehow I have 0.03$ revenue because someone in other country was able to click on ad (according to Geo Stats from admob site). I am confused...
     
  12. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi Lerp,
    Can you send me your unity game build, so that i can test it?
     
  13. Tano

    Tano

    Joined:
    Nov 11, 2009
    Posts:
    110
    When i try to compile your example i've this error:

    Code (csharp):
    1. JNI: Unable to find field id for 'currentActivity' (static)
    2. UnityEngine.AndroidJavaObject:GetStatic(String)
    3. AdvertisementHandler:Instantiate(String, AdvSize, AdvOrientation, Position, Position, Boolean, AnimationInType, AnimationOutType, LevelOfDebug) (at Assets/Scripts/Mics/Advertisement/AdvertisementHandler.cs:72)
    How can i Fix it? Thanks!
     
  14. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Tano, you're not trying to run the plugin in Editor, right?
     
  15. Deleted User

    Deleted User

    Guest

    Link to apk is in your inbox :)
     
  16. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    I haven't received yet, but as soon as i get, i will try to reply you within 2 hrs..
     
  17. Deleted User

    Deleted User

    Guest

    Hmm weird, its must be this forum issue. I've sent it to you 2 hours ago.



    Otherwise, I've also mailed you :)

    EDIT:

    Ok, I figured it out:

    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> .

    Value was set to 'false' in my AndroidManifest.xml.
     
    Last edited by a moderator: Jul 25, 2012
  18. Platinium

    Platinium

    Joined:
    Jul 3, 2012
    Posts:
    3
    Hello MicroEyes, i implemented your plugin in my game and works wonderfully, but i would like to know if is possible to use Smart Banner as advSize, i tried the Orientation Horizontal and position fill horizontal(my game is in landscape mode) but the banner doesn`t fill the entire bottom of cell phone in landscape mode.
    Is it possible for you to give me some guide lines to accomplish this?
    Thank you for this great plugin.
     
  19. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    this plugin is free?
     
  20. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Yes.. complete FREE..
     
  21. Deleted User

    Deleted User

    Guest

    Agree. Smart Banner AdSize would be great.
     
  22. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    I'll add smart banner in next update you will be notify.
     
  23. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    I'll add smart banner in next update you will be notify.
     
  24. KMI

    KMI

    Joined:
    Jul 11, 2012
    Posts:
    9
  25. totti10

    totti10

    Joined:
    Apr 4, 2012
    Posts:
    62
    @MicroEyes: can you provide the source code of com.microeyes.admob.jar,

    I need to implement other ads networks such as leadbolt, and mobclix


    Thanks
     
    Last edited: Aug 5, 2012
  26. Nova00

    Nova00

    Joined:
    Aug 5, 2012
    Posts:
    2
    Hello everybody,

    First of all, thank you MicroEyes for this plugin.
    I have a bit problem. It's the same that Lerp I think.
    I see the ad in my game but when i click, nothing occurs. MicroEyes, I downloaded your project and i tested it, there are the same problem.
    KMI, I downloaded your game too and apparently you have no this problem. Did you modify something in the script?
     
  27. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hello Nova00,
    Try this..

    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> .
    Value was set to false in AndroidManifest.xml, change it to true


    Hope this helps..
     
  28. Nova00

    Nova00

    Joined:
    Aug 5, 2012
    Posts:
    2
    By default, i have "true"

    Any other idea ?
     
    Last edited: Aug 5, 2012
  29. totti10

    totti10

    Joined:
    Apr 4, 2012
    Posts:
    62

    Can you upload or give a hint how com.microeyes.admob.jar code look like ?

    I need the source code to make Leadbolt ads integration ..
     
  30. claudiohcs

    claudiohcs

    Joined:
    Feb 17, 2012
    Posts:
    8
    Same problem here. This value on AndroidManifest.xml is 'true' and when I click on the ads nothing happens.
    My Unity version is 3.4.2f3 and the log file doesn't show any erros.

    I'm using the admob id default that comes with the plugin. It supposes to work with this id for tests?
     
    Last edited: Aug 11, 2012
  31. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Please Try with FALSE value there... Dont forgot to test my test project.
     
  32. jquery404

    jquery404

    Joined:
    May 21, 2012
    Posts:
    16
    Great , I've successfully added your plugin in my game and it worked. But Click is not working i tried following none of these worked :(
    plz help me ...

    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />

    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />

    <meta-data android:name="unityplayer.ForwardNativeEventsToDal vik" android:value="false" />

    <meta-data android:name="unityplayer.ForwardNativeEventsToDal vik" android:value="true" />
     
    Last edited: Aug 12, 2012
  33. claudiohcs

    claudiohcs

    Joined:
    Feb 17, 2012
    Posts:
    8
    Tried with "false" and "true" and still not working. I tried open your test project but, when unity asks for convert the project to the current version, an fatal error occurs and the only message is "!didInsert".

    To fix this error I deleted all contents (has to be all) in the folder "ProjectSettings". Your test project opens but without any elements in the scene. I guess this makes sense due to the fact I deleted all settings. After that, I added an camera to the scene and attached the AdvertisementManager to it.
    But when I tested in my cellphone, I had the same problem, the ads shows and I can hide/show or enable/disable but when I click on it, nothing happens.

    I found this on google: http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html
    "UnityPlayerNativeActivity
    It is also possible to create your own subclass of UnityPlayerNativeActivity. This will have much the same effect as subclassing UnityPlayerActivity but with improved input latency. Be aware, though, that NativeActivity was introduced in Gingerbread and does not work with older devices. Since touch/motion events are processed in native code, Java views would normally not see those events. There is, however, a forwarding mechanism in Unity which allows events to be propagated to the DalvikVM. To access this mechanism, you need to modify the manifest file as follows:"

    That part particulary, says that this kind of operation only works in Gingerbread version. I tried build my project in 2.3.1 and 2.3.3 but didn't work neither.

    Might this problem be something in build settings?
     
    Last edited: Aug 13, 2012
  34. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi jquery404 claudiohcs,
    I have downloaded my project from the first page for testing. But i didn't found any thing like you are having. I am completely able to click on my admob advertisement.

    Please do one more thing. Please build your project with LevelOfDebug as HIGH bcoz this will give you complete event tracking.
    If still you are unable to click on Advertisements, please forward me a link of build, so that i can test on my 4 devices. And remember to change LevelOfDebug to HIGH

    I have tested this admob plugin on Android 2.1. cant say below Android 2.1 devices.
     
  35. jquery404

    jquery404

    Joined:
    May 21, 2012
    Posts:
    16
    I just build my project with LevelOfDebug as High and no luck..
    bytheway im checking this in xperia arc s and Andriod 4.0.
    here is a link of my project folder ....

    http://jquery404.com/file/Test.unitypackage

    waiting for you reply
     
  36. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi jquery404,
    First of all, my apologies sir, you are having this issue.

    I am attaching a unitypackage. Please download use it.

    One more thing i wants to tell you guys, my plugin is not controlling OnClickListener() on AdView. bcoz its upto Google Admob plugin to add OnClickListener() on AdView. You can do one more thing.

    Whenever you click on AdView, two listener will listen your touch. You can track them in debug logs. Best IDE for android logs is Eclipse.
    First one is OnPresentScreen()(Controlling by Google admob package), this will write "onPresentScreen()" with TAG = "Ads" in my plugin "Present Screen" with TAG = "ADMOB".
    OnPresentScreen() will get called when an Activity is created in front of your app, presenting the user with a full-screen ad UI in response to their touching ad.

    Second one is OnLeavingApplication()(Controlling by Google admob package), this will write "OnLeaveApplication()" with TAG = "Ads" * in my plugin "Leaving Application" with TAG = "ADMOB".
    onLeaveApplication(Ad ad) will get called when an Ad touch will launch a new application.


    Check out for both logs written by my plugin Google Admob plugin reply whether they are in logs or not.

    Waiting for your reply...
     
  37. claudiohcs

    claudiohcs

    Joined:
    Feb 17, 2012
    Posts:
    8
    Hi,
    Same problem with this new unitypackage. I found something that might be useful in the logcat:

    I/Unity ( 7410): Unity Calling Start

    I/Unity ( 7410): UnityEngine.Debug:Internal_Log(Int32, String, Object)

    I/Unity ( 7410): UnityEngine.Debug:Log(Object)

    I/Unity ( 7410): AdvertisementManager:Start()

    I/Unity ( 7410):

    I/Unity ( 7410): (Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/Export/Generated/UnityEngineDebug.cpp Line: 34)

    I/Unity ( 7410):

    I/Unity ( 7410): NullReferenceException: Object reference not set to an instance of an object

    I/Unity ( 7410): at AdvertisementManager.Start () [0x00000] in <filename unknown>:0

    I/Unity ( 7410):

    I/Unity ( 7410): (Filename: Line: -1)
    --------------------------
    I/InputReader( 133): dispatchTouch::touch event's action is 0

    I/InputDispatcher( 133): Delivering touch to current input target: action: 0, channel '408ea6f8 com.Magiklavi.Luminattis/com.unity3d.player.UnityPlayerNativeActivity (server)'

    I/InputReader( 133): dispatchTouch::touch event's action is 1

    I/InputDispatcher( 133): Delivering touch to current input target: action: 1, channel '408ea6f8 com.Magiklavi.Luminattis/com.unity3d.player.UnityPlayerNativeActivity (server)'

    I/Unity ( 7410): ENABLED Called

    I/Unity ( 7410): UnityEngine.Debug:Internal_Log(Int32, String, Object)

    I/Unity ( 7410): UnityEngine.Debug:Log(Object)

    I/Unity ( 7410): AdvertisementHandler:EnableAds()

    I/Unity ( 7410): AdvertisementManager:OnGUI()

    I/Unity ( 7410):

    I/Unity ( 7410): (Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/Export/Generated/UnityEngineDebug.cpp Line: 34)

    I/Unity ( 7410):

    I/Unity ( 7410): NullReferenceException: Object reference not set to an instance of an object

    I/Unity ( 7410): at AdvertisementHandler.EnableAds () [0x00000] in <filename unknown>:0

    I/Unity ( 7410): at AdvertisementManager.OnGUI () [0x00000] in <filename unknown>:0

    I/Unity ( 7410):

    I/Unity ( 7410): (Filename: Line: -1)

    I/Unity ( 7410):

    D/Finsky ( 7505): [1] 5.onFinished: Installation state replication succeeded.

    I/ActivityManager( 133): Process com.android.vending (pid 7505) has died.

    I/ActivityManager( 133): Low Memory: No more background processes.
    ---------------------------

    Seems like a nullpointer is the problem.
    The functions OnPresentScreen and onLeaveApplication wasn't in the log.


    Maybe this is important too:


    I/Ads ( 2214): Refreshing ad.

    I/webclipboard( 2214): clipservice: android.sec.clipboard.ClipboardExManager@405f8a18

    D/WML_SISO( 2214): InitPasteboardJni

    I/Ads ( 2214): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"preqs":1,"session_id":"7492899656704948143","u_sd":1.5,"seq_num":"2","slotname":"a14e2fb60918999","u_w":533,"msid":"com.Magiklavi.Luminattis","js":"afma-sdk-a-v6.1.0","toar":0,"mv":"8013015.com.android.vending","prnl":2484,"isu":"CF95DC53F383F9A836FD749F3EF439CD","cipa":0,"format":"320x50_mb","net":"wi","app_name":"1.android.com.Magiklavi.Luminattis","hl":"pt","u_h":320,"carrier":"72402","ptime":17502,"u_audio":3,"prl":3281});</script></head><body></body></html>

    W/webcore ( 2214): Can't get the viewWidth after the first layout

    I/Ads ( 2214): Received ad url: <url: "http://googleads.g.doubleclick.net:80/mads/gma?preqs=1&session_id=7492899656704948143&u_sd=1.5&slotname=a14e2fb60918999&u_w=533&msid=com.Magiklavi.Luminattis&js=afma-sdk-a-v6.1.0&toar=0&mv=8013015.com.android.vending&prnl=2484&isu=CF95DC53F383F9A836FD749F3EF439CD&cipa=0&format=320x50_mb&net=wi&app_name=1.android.com.Magiklavi.Luminattis&hl=pt&u_h=320&carrier=72402&ptime=17502&u_audio=3&prl=3281&u_so=l&output=html&region=mobile_app&u_tz=180&ex=1&client_sdk=1&askip=1&caps=interactiveVideo_clickTracking_sdkAdmobApiForAds&jsv=29" type: "admob" afmaNotifyDt: "null">

    I/InputReader( 133): dispatchTouch::touch event's action is 0

    I/InputDispatcher( 133): Delivering touch to current input target: action: 0, channel '40b18050 com.Magiklavi.Luminattis/com.unity3d.player.UnityPlayerNativeActivity (server)'

    I/InputReader( 133): dispatchTouch::touch event's action is 1

    I/InputDispatcher( 133): Delivering touch to current input target: action: 1, channel '40b18050 com.Magiklavi.Luminattis/com.unity3d.player.UnityPlayerNativeActivity (server)'

    I/InputReader( 133): dispatchTouch::touch event's action is 0

    I/InputDispatcher( 133): Delivering touch to current input target: action: 0, channel '40b18050 com.Magiklavi.Luminattis/com.unity3d.player.UnityPlayerNativeActivity (server)'

    D/webviewglue( 2214): nativeDestroy view: 0xfa2718

    I/Ads ( 2214): onReceiveAd()

    I/ADMOB ( 2214): Adv Received

    I/ADMOB ( 2214): Adv displaying

    I/ADMOB ( 2214): hasGotAdv is true

    I/ADMOB ( 2214): Leaving inside if

    I/InputReader( 133): dispatchTouch::touch event's action is 1

    I/InputDispatcher( 133): Delivering touch to current input target: action: 1, channel '40b18050 com.Magiklavi.Luminattis/com.unity3d.player.UnityPlayerNativeActivity (server)'

    I/ADMOB ( 2214): Animation Start

    I/InputReader( 133): dispatchTouch::touch event's action is 0

    I/InputDispatcher( 133): Delivering touch to current input target: action: 0, channel '40b18050 com.Magiklavi.Luminattis/com.unity3d.player.UnityPlayerNativeActivity (server)'

    I/InputReader( 133): dispatchTouch::touch event's action is 1

    I/InputDispatcher( 133): Delivering touch to current input target: action: 1, channel '40b18050 com.Magiklavi.Luminattis/com.unity3d.player.UnityPlayerNativeActivity (server)'

    I/InputReader( 133): dispatchTouch::touch event's action is 0

    I/InputDispatcher( 133): Delivering touch to current input target: action: 0, channel '40b18050 com.Magiklavi.Luminattis/com.unity3d.player.UnityPlayerNativeActivity (server)'

    I/ADMOB ( 2214): Animation End
     
    Last edited: Aug 14, 2012
  38. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Can you tell me your android device model on which you are testing.? And also in which country you are living. You can PM me.
     
  39. claudiohcs

    claudiohcs

    Joined:
    Feb 17, 2012
    Posts:
    8
    I've sent to you an PM. Thanks!

    I found this on google:
    Well, the problem seems to be that I'm resizing the view frame, and putting the Ad outside this frame, so it can receive events. Seems to be solved resizing the first subview when I want to show the Ad:

    UIView *subview = [[self.view subviews] objectAtIndex:0];
    subview.frame = frame;
    Also I have to keep track of tab changes using UITabBarControllerDelegate for hiding the Ad.


    Maybe it's related with this: W/webcore ( 2214): Can't get the viewWidth after the first layout
     
    Last edited: Aug 15, 2012
  40. totti10

    totti10

    Joined:
    Apr 4, 2012
    Posts:
    62
    Don't use microeyes plugin, because he REFUSED to give the source of the Jar file.

    Since the microeyes plugin doesn't provide any source code, it might contain malicious code, or modifying publisher ID after specified period of time.

    Please stick to Official Admob Plugin Thread.

    I've uploaded new admob sdk 6 plugin (with full Source code)
     
  41. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hey little buddy totti(or whatever your name is),
    You are just jealous because i refused to give my code to you, and this doesn't mean that you have got the right to say anything about others.

    An application's code would be open for public or not, it only depends on developer not on some foolish people who vomits on someone's thread here-there. And i am not only the person on planet Earth whose code is not open for public.

    For your knowledge totti, this plugin came with source a month ago. After that I worked hard on this plugin to make it independent make it even better built it into a package so that people could integrate them with little effort removed the source.

    And also, i'll serve you for rest of my life, you could prove that my plugin contains malicious code or anything else in Law and its a Challenge.
     
  42. Platinium

    Platinium

    Joined:
    Jul 3, 2012
    Posts:
    3
    LoL and you can have the source code of a Jar file, just google a bit and you will see that are some programs that let you see and even modify it ...
     
  43. claudiohcs

    claudiohcs

    Joined:
    Feb 17, 2012
    Posts:
    8
    I dont believe that MicroEyes is putting some malicious code inside his jar...
    MicroEyes, did you find something about my problem?
     
  44. totti10

    totti10

    Joined:
    Apr 4, 2012
    Posts:
    62
    Talk is cheap !


    show me how to disassemble *.class file ?
    LoL
     
    Last edited: Aug 19, 2012
  45. crazy_boy_02

    crazy_boy_02

    Joined:
    Jul 20, 2012
    Posts:
    3
    @microeyes: Firstly thanks for the plugin.

    i implemented your code, its working fine but i was not able to change the adsize no matter which advsize i call it always shows banner ads.

    can you please help me out with this.
     
  46. miksumortti

    miksumortti

    Joined:
    Apr 7, 2012
    Posts:
    204
    Thank you MicroEyes for this great package.
    Used as a base for plugins integration in my game Spin-Tops and works good :)
     
  47. smilex0000

    smilex0000

    Joined:
    Jun 9, 2010
    Posts:
    18
    Thanks MicroEyes for sharing this greate plugin, I have made it work on my android app.
    However, I am a newbie in Android Developement. My question is about the admob test mode, Should I disable the test mode somewhere in your plugin?

    Thanks again.
     
  48. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    My Pleasure Sir.
     
  49. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Its all upto you smilex0000. You should disable Test Mode, Whenever you are done with your game test. When you run your application on Test Mode, Admob advertisements will come from Google's test adv server. it may won't affect your Admob credits.
     
  50. crazy_boy_02

    crazy_boy_02

    Joined:
    Jul 20, 2012
    Posts:
    3
    @microeyes: Firstly thanks for the plugin.

    i implemented your code, its working fine but i was not able to change the adsize no matter which advsize i call it always shows banner ads.

    can you please help me out with this.