Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

step by step documentation #33

Open
OURABIG opened this issue May 14, 2023 · 9 comments
Open

step by step documentation #33

OURABIG opened this issue May 14, 2023 · 9 comments

Comments

@OURABIG
Copy link

OURABIG commented May 14, 2023

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

@AGulev
Copy link
Owner

AGulev commented May 14, 2023

@OURABIG please share what exactly errors you have

@OURABIG
Copy link
Author

OURABIG commented May 17, 2023

@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

@AGulev
Copy link
Owner

AGulev commented May 17, 2023

Did you see the example in this repo?

@OURABIG
Copy link
Author

OURABIG commented May 17, 2023

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

@AGulev
Copy link
Owner

AGulev commented May 17, 2023

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

@OURABIG
Copy link
Author

OURABIG commented May 17, 2023

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

@OURABIG
Copy link
Author

OURABIG commented May 17, 2023

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

@AGulev
Copy link
Owner

AGulev commented May 17, 2023

  1. 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

  1. Wait for unityads.EVENT_COMPLETED in unityads.MSG_INIT :

https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L79-L82

  1. When it's done, you are able to use ADS functions. First of all you need to load ADS (in this function you use placementId of your AD as the first/only parameter):

https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L341

  1. When loading is done, you'll get unityads.EVENT_LOADED for message_id unityads.MSG_LOAD in the callback:

https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L130-L134

  1. Now you can show ADS (in this function you use placementId of your AD as the first/only parameter):

https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L346

  1. For the show() function you should use this message_id in the callback:
    https://github.com/AGulev/DefVideoAds/blob/abaeb8f6902457c638b3b08ab4e69ee567dd8b79/example/ui.gui_script#L94-L109

@AGulev
Copy link
Owner

AGulev commented May 17, 2023

Also, you can take a look this ads_wrapper , maybe it will be easier for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants