2016-04-07 2 views
0

Ich versuche, die Dokumentation in Optimizely zu folgen, um meine native App (@ 22.2) funktionsfähig zu bekommen, aber einen solchen Fehler zu bekommen.Verwendung von nativ mit Optimizely

MainActivity.java:24: error: cannot find symbol 
     Optimizely.startOptimizelyWithApiToken("xxxxxx", getApplication()); 
       ^
    symbol: method startOptimizelyWithApiToken(String,Application) 
    location: class Optimizely 
1 error 
:app:compileDebugJavaWithJavac 

Was ist falsch und wie kann ich debuggen. Ich versuche

adb logcat ReactNative:V ReactNativeJS:V 

aber es gibt mir keine Informationen

Antwort

0

i sortiert Problem mehr über ist docs lesen und mit Legacy:

compile ('com.optimizely:optimizely-legacy:[email protected]') { 
     transitive = true 
    } 

und dann:

Optimizely.startOptimizely("xxxx", getApplication()); 
3

I und wir haben ein brandneues Produkt namens FullStack herausgebracht, das mehr darauf ausgerichtet ist Entwickler. Als Teil des Produkts bieten wir jetzt ein JavaScript-SDK zum Ausführen von Tests in allen JavaScript-Clients, einschließlich React Native.

nutzen zu können, unser SDK installieren würde:

npm install optimizely-client-sdk

Und dann kann man Verkehr mit unseren activate und track Methoden gespalten. Hier

ein Beispiel:

var optimizely = require('optimizely-client-sdk'); 

// Initialize an Optimizely client 
var optimizelyClientInstance = optimizely.createInstance({ datafile: datafile }); 


// ALTERNATIVELY, if you don't use CommonJS or npm, you can install the minified snippet and use the globally exported varible as follows: 
var optimizelyClientInstance = window.optimizelyClient.createInstance({ datafile: datafile }); 


// Activate user in an experiment 
var variation = optimizelyClientInstance.activate("my_experiment", userId); 

if (variation === 'control') { 
    // Execute code for variation A 
} else if (variation === 'treatment') { 
    // Execute code for variation B 
} else { 
    // Execute default code 
} 

// Track conversion event 
optimizelyClientInstance.track("my_conversion", userId); 

Für weitere Informationen wenden Sie sich bitte unsere Entwickler docs Kasse: https://developers.optimizely.com/x/solutions/sdks/introduction/index.html?language=javascript

Verwandte Themen