defold-extension-unity-ads
defold-extension-unity-ads copied to clipboard
step by step documentation
i would like to add ads to my game but when i try this i get confused and i always have errors maybe if you can just make a step by step setup tutorial and how to show an ad like in a wiki or in a video and thanks for this amazing extension
@OURABIG please share what exactly errors you have
@OURABIG please share what exactly errors you have
well everything i can't even setup the ads or initialize them i just got confused to do it
Did you see the example in this repo?
Did you see the example in this repo?
yes of course and i didn't understand a lot it's a bit advance what should i create first
you said :
i always have errors
What kind of errors do you have? The install process is simple as:
- initialize
- wait when initialization is done
- show ads
you said :
i always have errors
What kind of errors do you have? The install process is simple as:
* initialize * wait when initialization is done * show ads
so i add the direcrly in .gui_script no need to another script
you said :
i always have errors
What kind of errors do you have? The install process is simple as:
* initialize * wait when initialization is done * show ads
i add initialize function and unity ads code then i go when button is clicked show ads is this what i need to do
- Initialize SDK with callback (third parameter
isDebug): https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L217
Here is an example of the callback function: https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L76-L189
- Wait for
unityads.EVENT_COMPLETEDinunityads.MSG_INIT:
https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L79-L82
- When it's done, you are able to use ADS functions. First of all you need to load ADS (in this function you use
placementIdof your AD as the first/only parameter):
https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L341
- When loading is done, you'll get
unityads.EVENT_LOADEDfor message_idunityads.MSG_LOADin the callback:
https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L130-L134
- Now you can show ADS (in this function you use
placementIdof your AD as the first/only parameter):
https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L346
- For the
show()function you should use thismessage_idin the callback: https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L94-L109
Also, you can take a look this ads_wrapper , maybe it will be easier for you.