THEMEN×
Developer quick start
Im Folgenden finden Sie einige Informationen zur Implementierung der universellen Windows-Plattformbibliothek.
Zum Implementieren des SDK benötigen Sie Visual Studio 2013 oder höher.
SDK abrufen
After you unzip the
SDK download
file, you will have a separate folder for each supported architecture and platform combination. Sie haben auch eine
ADBMobileConfig.json
Datei. Weitere Informationen zu dieser Datei finden Sie in der Konfigurationsdatei
ADBMobileConfig.json
.
Select the correct version
Different
.dll/.winmd
files are provided for each supported architecture (x86, x64, ARM).
The version of
ADBMobile.winmd
does not reflect the version of the library. Die
.winmd
Datei enthält nur Metadaten und verfügt über eine Versionsnummer
255.255.255.255
, die gemäß Microsoft akzeptiert wird. Weitere Informationen finden Sie unter
Wie kann ich Assemblyinformationen für eine WinRT C++/CX-Komponente hinzufügen?
. To check the version of the library you are using, check the version of the underlying
ADBMobile.dll
file.
Unterschiede in der Syntax
Die Bibliothek für die universelle Windows-Plattform kann in mehreren Programmiersprachen verwendet werden. Die Beispiele in diesem Handbuch sind in WinJS (JavaScript), wenn Sie eine andere Sprache verwenden, müssen möglicherweise geändert werden. Wenn Sie winmd-Methoden von winJS verwenden, wird bei allen Methoden automatisch der erste Buchstabe verringert.
Der Hauptunterschied zwischen den verschiedenen Implementierungen besteht in der für die Kontextdaten verwendeten Datenstruktur. Additionally, when using the SDK in a WinJS project, use an empty string (
""
or
''
) instead of
null
for empty string values.
Add the library and config File to your project - C#
- Starten Sie Visual Studio und öffnen Sie Ihre Lösung.
- 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.Weitere Informationen finden Sie unter Auswählen der richtigen Version auf dieser Seite.
- Klicken Sie auf Hinzufügen .
- 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 .Wenn auch ein C++-Projekt in Ihrer Lösung vorhanden ist, überspringen Sie diesen Schritt.
- Wählen Sie auf der linken Registerkarte " Windows "die Option " Erweiterungen ", wählen Sie Visual C++ 2015 Runtime for Universal Windows Platform Apps aus und fügen Sie sie hinzu.
- Fügen Sie Ihrer Klasse die folgende Zeile hinzu:
using ADBMobile;
- Right-click your project and click Add > Existing Item .
- Browse to the ADBMobileConfig.json file and click Add .
- Klicken Sie mit der rechten Maustaste auf die ADBMobileConfig.json Datei in Ihrer Lösung und wählen Sie Eigenschaften .
- Change Build Action to Content .
Add the library and config file to your project - C++
- Starten Sie Visual Studio und öffnen Sie Ihre Lösung.
- In the Solution Explorer , right-click your project and select Add > References .
- Wählen Sie die richtige Version der Bibliothek aus und fügen Sie der zugehörigen Datei ADBMobile.winmd einen Verweis hinzu.Weitere Informationen finden Sie unter Auswählen der richtigen Version auf dieser Seite.
- Klicken Sie auf Hinzufügen .
- Vergewissern Sie sich, dass ADBMobile.winmd im Fenster Reference Manager (Referenz-Manager) markiert ist, und klicken Sie auf OK .
- Fügen Sie Ihrer Klasse die folgende Zeile hinzu:
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 .
Add the library and config file to your project - WinJS
- Starten Sie Visual Studio und öffnen Sie Ihre Lösung.
- 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.
- Klicken Sie auf Hinzufügen .
- 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.
Update The ADBMobileConfig.json config file
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.
Im Folgenden finden Sie ein Beispiel für eine
ADBMobileConfig.json
-Datei:
{ "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" } }
Aktualisieren Sie mindestens die folgenden Werte für die verwendeten Lösungen:
- Adobe Analytics : rsids und server
- Adobe Target : clientCode
- Adobe Audience Manager : server
For more information, see
SDK methods
.
Debugging
To enable debugging for the SDK, call
ADBMobile.Config.setDebugLogging(true);
.
Für C Sharp- und JavaScript-Apps müssen Sie das Debugging von nativem Code aktivieren, indem Sie die folgenden Schritte ausführen (für C++-Apps ist das native Code-Debugging die Standardeinstellung):
C Sharp
- Klicken Sie mit der rechten Maustaste auf das Projekt und klicken Sie auf Eigenschaften > Registerkarte Debuggen .
- Ändern Sie das Dropdown für den Debuggertyp in Native Only (Nur nativ).
JavaScript
- Right-click the project, click Properties > Configuration Properties > Debug tab .
- Change the debugger type drop down to Native Only .
Das ist alles! Jetzt können Sie Analytics, Target und Zielgruppen-Management in Ihrer Anwendung für die universelle Windows-Plattform implementieren.