You can serve advertisements in your exported hyperPad projects to earn revenue. First, you'll need to sign up for Google AdMob. If you are already signed up, you can log in.
Once your account is good to go, you will need to set up an app in AdMob. Don't worry, even if your app is not in the App Store yet, you can still serve advertisements. You can follow this article provided by Google AdMob.
After creating an app in Google AdMob, you need to create an Ad Unit which will be responsible for serving advertisements in your project. Follow the instructions of creating and tweaking your Ad Unit in this article provided from Google AdMob. From there, you want to take note the Ad Unit ID
which you can use in your behaviors.
After retrieving your Ad Unit ID
, you can start using it to serve advertisements.
Trying Out Demo Ad Units
If you simply want to prototype your app and you don't need real advertisements at the moment, you can use AdMob's demo ad units to serve placeholder ads. Use this to test if the ads will function as intended in your project before trying to serve advertisements. You can use the provided Ad Unit ID
from this table to try out a demo unit - an account is not required to access them, so use them as much as you need! Just make sure you replace them with the Ad Unit IDs from your actual Ad Units before exporting your project.
Ad Format | Ad Unit ID | Usage |
Adaptive Banner |
ca-app-pub-3940256099942544/ |
Advertisement Banner |
Interstitial |
ca-app-pub-3940256099942544/ |
Trigger Ad behavior (Interstitial) |
Rewarded Interstitial |
ca-app-pub-3940256099942544/ |
Trigger Ad behavior (Reward Based Video) |
You can see a full list of these demo ad units and learn more about them here.
Setting Up an Advertisement Banner
To set up an advertisement banner, navigate to the scene editor and press on the flask icon near the bottom right corner of the screen or perform ⌘ + A
.
Select Advertisement to add an advertisement banner object to your scene.
You will be given options on where you can put your banner and which UI layer to add it to.
- Ad Position: Your banner could be either at the top of the screen or the bottom of the screen.
- UI Layer: You can choose between Global and Scene UI layers. Picking Scene UI will have your banner only show up for a specific scene, whereas Global UI will have your banner show across all scenes.
After creating your advertisement banner, you can select it and provide the Ad Unit ID
. You can also adjust the size of your banner to fit your specific needs.
If all is successful, you will be able to see advertisements on your banner. If your app is verified, your users will see real advertisements.
If you would like to adjust your banner on-the-fly while the project is running, you can use the Manage Ad Banner behavior.
You can reward users for clicking on the ad banner by using the Ad Clicked behavior. It is an event behavior that triggers when the ad has been clicked.
Serving Interstitial or Rewarded Advertisements
To serve interstitial or rewarded advertisements, you can use the Trigger Ad behavior. It is an action behavior, so when you want to serve an advertisement, you can execute this behavior. You simply provide the Ad Unit ID
in the behavior, and you're good to go!
If you're serving rewarded ads, you must set the Ad Type in the behavior to Reward Based Video
. You can plug the output of the behavior to an If behavior to check if the ad should reward the user. If rewarded
is equal to 1, then you can execute other behaviors to reward the user.
Managing AdMob in an Exported Project
After exporting your project, in Xcode, you want to update your app's Info.plist
file to add two keys. Refer to the image below.
- You will need to set the
GADApplicationIdentifier
key with a string value of your AdMob app ID - this will help Google AdMob identify your app in order to serve advertisements on your behalf. Learn how to retrieve your AdMob app ID here. - You will need to set the
SKAdNetworkItems
key to an array of dictionaries. Each dictionary has a keySKAdNetworkIdentifier
with values for Googlecstr6suwn9.skadnetwork
and select third-party buyers who have provided these values to Google.
Alternatively, you can copy and paste this snippet provided by Google AdMob into your app's Info.plist
file (you'll have to edit it as a text, then save it).
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4fzdc2evr5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2fnua5tdw4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ydx93a7ass.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>p78axxw29g.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v72qych5uu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ludvb6z3bs.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cp8zw746q7.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3sh42y64q3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>c6k4g5qg8m.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>s39g8k73mm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qy4746246.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>f38h382jlk.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>hs6bdukanm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>mlmmfzh3r3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v4nxqhlyqp.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>wzmmz9fp6w.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>su67r6k2v3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>yclnxrl5pm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>t38b2kh725.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>7ug5zh24hu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>gta9lk7p23.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>vutu7akeur.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>y5ghdn5j9k.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v9wttpbfk9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>n38lu8286q.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>47vhws6wlr.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>kbd757ywx3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9t245vhmpl.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>a2p9lx4jpn.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>22mmun2rn5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>44jx6755aq.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>k674qkevps.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4468km3ulz.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2u9pt9hc89.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>8s468mfl3y.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>klf5c3l5u5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ppxm28t8ap.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>kbmxgpxpgc.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>uw77j35x4d.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>578prtvx9j.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4dzt52r2t5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>tl55sbb4fm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>c3frkrj4fj.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>e5fvkxwrpn.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>8c4e2ghe7u.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3rd42ekr43.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>97r2b46745.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qcr597p9d.skadnetwork</string>
</dict>
</array>
After following the steps above, you no longer need to make any more modifications and you're good to submit your App to the App Store! However, you will need to verify your app in order for it to start serving paid advertisements to your users. To verify your app, you will need to create your apps-ads.txt file. Please refer to AdMob's guide in creating this file.
After verifying your app with the apps-ads.txt file, your published app will start showing real advertisements and you've successfully monetized your project!
0 Comments