User Guide Tapnation SDK
User Guide Tapnation SDK
Author
Nicot Fabien
SDK Engineer
[email protected]
CONTENTS
Contents
Table des matières 2
1 SDK integration 3
1.1 FunGamesSDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Other Sdk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Package Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.1 Mobile Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.2 iOS 14 Advertising Support . . . . . . . . . . . . . . . . . . . . . . 4
2 Settings 6
2.1 GameAnalytics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.1 Account creation and settings . . . . . . . . . . . . . . . . . . . . . 6
2.1.2 Unity project settings . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Firebase Analytics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Facebook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Fungames SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Implementation 11
3.1 GameAnalytics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.1 Progression Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.2 Design Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 Applovin Max Ads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2.1 Interstitial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2.2 Banners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2.3 Rewarded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3 Remote config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4 Ogury . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4.1 Thumbnail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4.2 Ogury Consent Manager . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 Notification Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.1 iOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.5.2 Android . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.6 Adjust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.7 GDPR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4 Troubleshooting 21
4.1 Unity : Namespace could not be found . . . . . . . . . . . . . . . . . . . . 21
4.2 iOs : .h file not found . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3 Android : Google Play Services . . . . . . . . . . . . . . . . . . . . 21
4.4 FacebookSettings on Windows : OpenSSL Not Found . . . . . . . . . . 22
4.5 FacebookSettings on Windows : Keytool not found . . . . . . . . . . 22
4.6 Facebook web : Account not activate . . . . . . . . . . . . . . . . . 23
1
CONTENTS
Introduction
The TapNation SDK allows you to easily integrate some of the features that will be
necessary for the success and monetization of your game. For this we have integrated
SDKs that allow us to perform several tasks.
• Game Analytics SDK is required in order to send, collect and aggregate game
and user data.
• Firebase Analytics is used to send events that will be useful to create targeted
monetization campaigns
• Ogury SDK is also used to display ads in thumbnail format and make cross-
promotions.
2
1 SDK INTEGRATION
1 SDK integration
The different SDKs will have to be installed with Unity Packages.
To import a new custom package:
• Open the unity project of your game.
• Choose Assets > Import Package > Custom Package to bring up up File Explorer
(Windows) or Finder (Mac).
• Select the package you want from Explorer or Finder, and the Import Unity Package
dialog box displays, with all the items in the package pre-checked, ready to install.
• Select Import and Unity puts the contents of the package into the Assets folder,
which you can access from your Project View.
1.1 FunGamesSDK
To integrate the FunGamesSdk, you just have to import the Unity package we sent you.
The SDK is divided in 3 folders, the first FunGamesSDK contains all the assets of our
SDK, the second folder FunGamesSdkPackages contains all the unity package that you
will have to install and the last folder Resources where we have our settings.
In case of problem you can try to download the latest at the following links :
• AppLovin MAX SDK : https://dash.applovin.com/documentation/
mediation/unity/getting-started/integration
3
1 SDK INTEGRATION
The Adjust package have to be installed only if your manager at TapNation asks
you to install it, indeed it is not necessary in the first stages of life of your application.
Here is the link to download the latest version of the SDK https://github.com/
adjust/unity_sdk/releases, please download the .unitypackage file of the most
recent version, so you can import it into your project like any other package.
4
1 SDK INTEGRATION
will have to click on the settings button in the top right corner of the window, next to the
search field. Please click on Advanced Package Settings and then click on Enable Preview
Packages. You will then be able to add the iOS 14 Advertising Support package to the
Unity Registry list.
5
2 SETTINGS
2 Settings
In this section we will show you how to make all the settings you will need to make in
order for all the features to work properly.
2.1 GameAnalytics
First of all I invite you to consult the links to the detailed documentation of GameAn-
alytics https://gameanalytics.com/docs/s/topic/0TO6N000000XZDuWAO/
unity-sdk.
Then we will receive emails from GameAnalytics to have the data from the chosen
game
6
2 SETTINGS
After logging in, enter your information by clicking on the Add Platform button and
selecting your game, your keys should be entered automatically.
Then the last step is to add the GameObject from GameAnalytics to your main scene.
You can add it via the menu available in the toolbar Window -> GameAnalytics ->
Select Settings
2.3 Facebook
Here you’ll have to create the Facebook page for your app in Facebook for developers
• Go to My Apps -> Add a New App -> Integrate a Third-Party Gaming App
7
2 SETTINGS
• Add the infos Display Name, Privacy Policy URL, Contact Email
• Make sure to select the Category
• Make sure to put the app on Public Mode (ON on the top bar)
• At the bottom of the page,click on “add platform”
• Add Bundle ID and other information
8
2 SETTINGS
Then go to Settings -> Advanced -> go in Business Manager section -> Click on your
Business Manager already existing or create a new one (save changes) -> Then click on
“Configure in business Manager" -> on “Partner” section (on the left of the screen) click
on “Partner with whom to share resources” Here you will be able to add our Business
Manager ID : 162137548103752 in the section "Enter Partner Business ID". If adding
this manager doesn’t work please try with the following IDs :
• Maryse : 100006161345376
• Nassim : 100000073775096
• Jatin : 100000052222087
Finally you can go back to your Unity project and go to the menu available in the
toolbar. Facebook -> Edit Settings.
• Assets
• Resources
• Right click
• Create
• FunGamesSdk
• Settings
If you still have errors, then the sub-menu FunGamesSdk will not appear if this is the
case please go to Troubleshooting.
9
2 SETTINGS
Now you can fill in the different fields, the most important keys are those of Game-
Analytics and Facebook (you will also have to check the "Use Facebook" and "Use
GameAnalytics" boxes). To know which SDKs you should set up and implement in
your game, please ask your TapNation manager.
The last step is to add to your main scene the prefab of FunGamesSdk to the path
Assets/FunGamesSdk/FunGamesSdk (Prefab Asset)
10
3 IMPLEMENTATION
3 Implementation
In order to help you in the implementation of the various functionalities we have put
at your disposal several examples to help you, we have put at your disposal a complete
project where all the SDKs are implemented.
In addition, please always test your application on your smartphone, because most of
the features are not available in the Unity editor runtime.
3.1 GameAnalytics
We have implemented the majority of GameAnalytics features, you can access them in
the FunGamesAnalytics class. With GameAnalytics you can send 3 types of events.
using FunGames.Sdk.Analytics;
FunGamesAnalytics.NewProgressionEvent(“Start”,level)
FunGamesAnalytics.NewProgressionEvent(“Start”,level,
,→ sublevel)
// Level Complete
// sublevel and score are optional
FunGamesAnalytics.NewProgressionEvent(“Complete”, level)
FunGamesAnalytics.NewProgressionEvent(“Complete”, level,
,→ sublevel)
FunGamesAnalytics.NewProgressionEvent(“Complete”, level,
,→ sublevel, score)
// Level Fail
// sublevel and score are optional
FunGamesAnalytics.NewProgressionEvent(“Fail”,level)
FunGamesAnalytics.NewProgressionEvent(“Fail”,level,
,→ sublevel)
11
3 IMPLEMENTATION
// eventValue is optional
using FunGames.Sdk.Analytics;
In order for the ads to work you need to go to the FunGames settings and activate
Applovin Max and fill in the different keys for this you need
• Create a build, just initializing the Sdk (without the Ad Units Id) and run it on
your device (real device)
• The ad unit ids will then be created on our backend. You need to ask the publishing
team for those ad unit ids.
• Once you have those units, please integrate them in the FunGamesSettings in the
Ressource Folder.
3.2.1 Interstitial
Interstitial ads take the whole screen they are often put at the end of the level. In order
to integrate it into your game you will have to use the following function :
12
3 IMPLEMENTATION
FunGamesMax.ShowInterstitial(GoToNextLevel);
The GoToNextLevel function is a callback you should create that will run when the
ad does not display properly.
3.2.2 Banners
Banner ads appear at the bottom of the screen, it is often displayed in the menu. In
order to integrate it into your game you will have to use the following function:
FunGamesMax.ShowBannerAd();
FunGamesMax.HideBannerAd();
Once the ShowBannerAd function has been called, as soon as a banner ad is available
it will be automatically displayed. The HideBannerAd function can be used to force the
banner not to be displayed as long as the ShowBannerAd function is called again.
3.2.3 Rewarded
Rewarded ads are used when you want to reward the user for watching ads. This
advertising format allows to retrieve the state of the completion of the advertisement via
callback. In order to integrate it into your game you will have to implement it in the
following way:
13
3 IMPLEMENTATION
Once the ShowBannerAd function has been called, as soon as a banner ad is available
it will be automatically displayed. The HideBannerAd function can be used to force the
banner not to be displayed as long as the ShowBannerAd function is called again.
14
3 IMPLEMENTATION
Alongside with the Sdk, there is a file called ExampleRemoteConfig.cs where you will
have some examples on how to integrate them.
15
3 IMPLEMENTATION
3.4 Ogury
3.4.1 Thumbnail
First of all, you will have to activate Ogury in the FunGames settings, the keys and
ids will be given to you by our team. The thumbanail is a small ad format that will be
displayed as an overlay in the place you would have indicated.
FunGamesThumbail.ShowThumbnailAd();
Once this function is called the ad will be displayed each time an ad is available again.
// Do it at that start
FungamesOguryChoiceManager.Start();
// Needed to be accessible in settings menu
OguryChoiceManager.Edit();
Please use the preprocessor variables for iOS and Android for the SDK of both is not
called at the same time, using the following Preprocessor Directives
16
3 IMPLEMENTATION
#if UNITY_IOS
Debug.LogWarning("You are on an iOS mobile
,→ device");
# elif UNITY_ANDROID
Debug.LogWarning("You are on an Android mobile
,→ device");
#else
Debug.LogWarning("You are not on a mobile
,→ device");
#endif
For the moment we have overloaded the notifications only for notifications scheduled
at a specific date, but the possibility to make notifications from a server (for example, for
events) will be added in a future version.
3.5.1 iOS
In order to integrate notifications on an application for iOS, the user’s agreement must
first be collected. There are 3 ways to do this, you can go to Project Settings
-> Mobile Notifications and in the window in the iOS tab, enable the Request
Authorization on App Launch option and click on the Default Notification Authorization
Option button and check Badges, Sound and Alert.
When you want to instantiate a new notification, we check that the authorization has
been granted, otherwise we ask for it again until the user has made a choice.
However, if you want to create a notification but want to control when the user gives
his permission. You have to use the following line:
FunGamesNotifs._instance.AskRequest();
To create or delete notifications already scheduled you must use the following functions.
17
3 IMPLEMENTATION
FunGamesNotifs._instance.RemoveNotif("NotifsTest1");
FunGamesNotifs._instance.RemoveAllNotif()
FunGamesNotifs._instance.CreateTimeIntervalNotifs(0, 0,
,→ 10, "NotifsTest1", "Title of the notifs", "Body of
,→ the the notifs", "This a test");
In addition you can retrieve the notification that the user used to join the application,
if the user did not use a notification to open the application then the returned notification
will be null and void. You can implement it in the following way :
iOSNotification notification =
,→ FunGamesNotifs._instance.GetNotifUserOpenAppWith();
if (notification != null)
{
var msg = "Last Received Notification: " +
,→ notification.Identifier;
msg += "\n - Notification received: ";
msg += "\n - .Title: " + notification.Title;
msg += "\n - .Badge: " + notification.Badge;
msg += "\n - .Body: " + notification.Body;
msg += "\n - .CategoryIdentifier: " +
,→ notification.CategoryIdentifier;
msg += "\n - .Subtitle: " + notification.Subtitle;
msg += "\n - .Data: " + notification.Data;
Debug.Log(msg);
,→ FunGamesAnalytics.NewDesignEvent("NotificationOpenAppWith",
,→ notification.Identifier);
}
3.5.2 Android
The first thing to do on Android is to go in go to Project Settings -> Mobile Notifications
and in the window in the Android tab to enable Reschedule on Device Resart, because
by default android remove all the notification when a device is restart.
The first thing you will have to do is to create a channel in which you can instantiate
the notifications in the following way. You also have a function that allows you to delete
all the notifications.
18
3 IMPLEMENTATION
FunGamesNotifs.SetChannel("channel_id", "Default
,→ Channel", "Generic notifications");
FunGamesNotifs.CreateTimeIntervalNotifs("Title of the
,→ notifs", "Body of the the notifs", "channel_id", 0,
,→ 0, 10);
In addition you can retrieve the notification that the user used to join the application,
if the user did not use a notification to open the application then the returned notification
will be null and void. You can implement it in the following way :
AndroidNotificationIntentData notification =
,→ FunGamesNotifs._instance.GetNotifUserOpenAppWith();
if (notification != null)
{
var msg = "Last Received Notification: " +
,→ notification.Id;
msg += "\n - Notification received: ";
msg += "\n - .Channel ID: " + notification.Channel;
msg += "\n - .Title: " +
,→ notification.Notification.Title;
msg += "\n - .Text: " +
,→ notification.Notification.Text;
Debug.Log(msg);
FunGamesAnalytics.NewDesignEvent(
,→ "NotificationOpenAppWith",
,→ notification.Id.ToString());
}
3.6 Adjust
First of all there are no settings to do beforehand, you have to ask your TapNation
manager to create your application on his adjust panel, you will receive an email from
Adjust with the token of your application.
Then to implement your application you will need to perform the following steps
19
3 IMPLEMENTATION
• Set the Environment to Sandbox when you are testing adjust on your phone and
otherwise set it to production
3.7 GDPR
For the European countries and for California, we have implemented a module allowing
to track users despite the GPDR. For this we have developed a popup to make the user
accept the GDPR. Moreover this popup is localized, meaning that users outside Europe
will not see the popup. Finally, it is only visible when the user launches the application
for the first time.
You will have to adapt the prefabs to your game (it is present in the prefabs FunGamesSdk),
for that you must first change the name of the game in the explanation text. Also you will
have to add the privacy links of each network adapters you have added to your game.
20
4 TROUBLESHOOTING
4 Troubleshooting
4.1 Unity : Namespace could not be found
If you have the following error, it’s because a package is missing, you have to look at
the name of the matching namespace and import the package corresponding to this name.
– Then try to build via the .xcworkspace file and not the .xcodeproj file.
21
4 TROUBLESHOOTING
In this case you can try to delete one of the versions of the files that are in conflict, for ex-
ample : google-play-services_lib folder or play-services-ads-9.4.0.arr
and play-services-basement-9.4.0.arr
• Download and install OpenSSL according to your system and not the light version.
http://slproweb.com/products/Win32OpenSSL.html
– Go to: Control Panel > System > Advanced system settings > Environment
Variables
– Select the Variable "Path" in the "System variables" window and click Edit.
– Add the path to your OpenSSL bin folder by clicking to "New". By example :
"C:\Program Files\OpenSSL-Win64\bin" to the end of the value text.
• Restart Unity3D.
– Go to: Control Panel > System > Advanced system settings > Environment
Variables
– Select the Variable "Path" in the "System variables" window and click Edit.
– Add the path to your JDK bin folder by clicking to "New". By example
: "C:\Program Files (x86)\Java\jdk-15.0.2\bin" to the end of
the value text.
• Restart Unity3D.
22
4 TROUBLESHOOTING
23
4 TROUBLESHOOTING
Conclusion
The setup of your game should be good, but if you have any questions or problems
please contact your manager at TapNation who will take care of you and inquire about
your potential problems. Also if you have any comments on the SDK implementation
process, we will be happy to hear your feedback on this process.
If everything is set up correctly, please return to your manager so that he can tell you
the next steps to follow.
24