Skip to content

Commit 4a07190

Browse files
committed
chore: fix tests
1 parent 8446d7e commit 4a07190

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/core/android/src/main/java/com/segment/analytics/reactnative/core/RNAnalyticsModule.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ class RNAnalyticsModule(context: ReactApplicationContext): ReactContextBaseJavaM
4242

4343
@ReactMethod
4444
fun setup(options: ReadableMap) {
45-
val android = options.getMap("android")
4645
val builder = Analytics
47-
.Builder(reactApplicationContext, android.getString("writeKey"))
46+
.Builder(reactApplicationContext, options.getString("writeKey"))
4847
.flushQueueSize(options.getInt("flushAt"))
4948

5049
if(options.getBoolean("recordScreenViews")) {

packages/core/ios/RNAnalytics/RNAnalytics.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ +(void)initialize {
3333
@synthesize bridge = _bridge;
3434

3535
RCT_EXPORT_METHOD(setup:(NSDictionary*)options) {
36-
SEGAnalyticsConfiguration* config = [SEGAnalyticsConfiguration configurationWithWriteKey:options[@"ios"][@"writeKey"]];
36+
SEGAnalyticsConfiguration* config = [SEGAnalyticsConfiguration configurationWithWriteKey:options[@"writeKey"]];
3737

3838
config.recordScreenViews = [options[@"recordScreenViews"] boolValue];
3939
config.trackApplicationLifecycleEvents = [options[@"trackAppLifecycleEvents"] boolValue];

packages/test-app/generate.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ cat << EOF >> App.js
2626
buildId = '$CIRCLE_WORKFLOW_ID'
2727
2828
analytics
29-
.configure()
30-
.using($integrations_require)
31-
.debug()
32-
.setup('$SEGMENT_WRITE_TOKEN')
33-
.then(() => console.log('Analytics ready'))
29+
.setup('$SEGMENT_WRITE_TOKEN', {
30+
using: [$integrations_require],
31+
debug: true
32+
})
33+
.then(() => console.log('Analytics ready'))
34+
.catch(err => console.error('Analytics error', err))
3435
EOF
3536

3637
../android-workaround.js

0 commit comments

Comments
 (0)