Here is some information about how to implement the Universal Windows Platform library.
Important: To implement the SDK, you need Visual Studio 2013 or later.
After you unzip the SDK download file, you will have a separate folder for each supported architecture and platform combination. You will also have an ADBMobileConfig.json
file. For more information about this file, see ADBMobileConfig.json config file.
Different .dll/.winmd
files are provided for each supported architecture (x86, x64, ARM).
Important: The version of
ADBMobile.winmd
does not reflect the version of the library. The.winmd
file contains only metadata and has a version number of255.255.255.255
, which is accepted behavior according to Microsoft. For more information, see How do I add assembly information for a WinRT C++ / CX component dll?. To check the version of the library you are using, check the version of the underlyingADBMobile.dll
file.
The Universal Windows Platform library can be used in several programming languages. The examples in this guide are in WinJS (JavaScript), if you are using a different language, might need to be modified. When you consume winmd methods from winJS, all methods automatically have their first letter lowercased.
The main difference between the implementations is the data structure used for context data. Additionally, when using the SDK in a WinJS project, use an empty string ( ""
or ''
) instead of null
for empty string values.
-
Launch Visual Studio and open your solution.
-
In the Solution Explorer, right-click References and select Add Reference.
-
Select the correct version of the library and browse to the associated ADBMobile.winmd file.
For more information, see Select the correct version section on this page.
-
Click Add.
-
Verify that the ADBMobile.winmd file is checked in the Reference Manager window and click OK.
-
In the Solution Explorer, right-click References and select Add Reference.
If you also have a C++ project in your solution, skip this step.
-
In the Windows tab on the left, select Extensions, select and add Visual C++ 2015 Runtime for Universal Windows Platform Apps.
-
Add the following line to your class:
using ADBMobile;
-
Right-click your project and click Add > Existing Item.
-
Browse to the
ADBMobileConfig.json
file and click Add. -
Right-click on the
ADBMobileConfig.json
file in your solution and select Properties. -
Change Build Action to Content.
-
Launch Visual Studio and open your solution.
-
In the Solution Explorer, right-click your project and select Add > References.
-
Select the correct version of the library and add a reference to the associated ADBMobile.winmd file.
For more information, see Select the correct version section on this page.
-
Click Add.
-
Verify that
ADBMobile.winmd
is checked in the Reference Manager window and click OK. -
Add the following line to your class:
using namespace ADBMobile;
-
Right-click your project and select Add > Existing Item.
-
Browse to
ADBMobileConfig.json
file and click Add. -
Right-click the
ADBMobileConfig.json
file in your solution and select Properties. -
On the General tab, change Content to Yes and click OK.
-
Launch Visual Studio and open your solution.
-
In the Solution Explorer, right-click References and select Add Reference.
-
Select the correct version of the library and browse to the associated ADBMobile.winmd file.
-
Click Add.
-
Verify that the ADBMobile.winmd file is checked in the Reference Manager window and click OK.
-
In the Solution Explorer, right-click References and select Add Reference.
If you also have a C++ project in your solution, skip this step.
-
In the Windows tab on the left, select Extensions and select and add Visual C++ 2015 Runtime for Universal Windows Platform Apps.
-
Right-click your project and select Add > Existing Item.
-
Browse to the
ADBMobileConfig.json
file and click Add. -
Right-click the
ADBMobileConfig.json
file in your solution and select Properties. -
With File Properties selected, ensure Package Action is set to Content.
For JavaScript projects, the file is set to Content by default.
The ADBMobileConfig.json
file contains global SDK settings and is located at your project root after you complete the steps in the Add the library and config file to your project section. If your ADBMobileConfig.json
file was not pre-configured by Adobe Mobile Services, you need to update a few values to get started.
Here is an example of an ADBMobileConfig.json
file:
{
"version" : "1.0",
"analytics" : {
"rsids" : "coolApp",
"server" : "my.CoolApp.com",
"charset" : "UTF-8",
"ssl" : true,
"offlineEnabled" : true,
"lifecycleTimeout" : 300,
"privacyDefault" : "optedin",
"poi" : [
["san francisco",37.757144,-122.44812,7000],
["santa cruz",36.972935,-122.01725,600]
]
},
"target" : {
"clientCode" : "myTargetClientCode",
"timeout" : 1
},
"audienceManager" : {
"server" : "myServer.demdex.com"
}
}
At a minimum, update the following values for the solutions you are using:
-
Adobe Analytics:
rsids
andserver
-
Adobe Target:
clientCode
-
Adobe Audience Manager:
server
For more information, see SDK methods.
To enable debugging for the SDK, call ADBMobile.Config.setDebugLogging(true);
.
For C Sharp and JavaScript apps, you need to enable native code debugging by completing the following steps (native code debugging is the default setting for C++ apps):
-
Right-click the project, click Properties > Debug tab.
-
Change the debugger type drop down to Native Only.
-
Right-click the project, click Properties > Configuration Properties > Debug tab.
-
Change the debugger type drop down to Native Only.
That's it! You're now ready to implement Analytics, Target, and Audience Management in your Universal Windows Platform app.