Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Feb 8, 2022
2 parents 809d74f + 5d8e4af commit 8cb037b
Show file tree
Hide file tree
Showing 52 changed files with 4,127 additions and 2,892 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:
echo "Tag version (${{ steps.version.outputs.TAG_VERSION }}) doesn't match version in project(ios) (${{ steps.version.outputs.RN_IOS_TRACKER_VERSION }})"
exit 1
fi
if [ "${{ steps.version.outputs.TAG_VERSION }}" != "${{ steps.version.outputs.RN_TRACKER_VERSION }}" ] ; then
echo "Tag version (${{ steps.version.outputs.TAG_VERSION }}) doesn't match version in project(android) (${{ steps.version.outputs.RN_ANDR_TRACKER_VERSION }})"
if [ "${{ steps.version.outputs.TAG_VERSION }}" != "${{ steps.version.outputs.RN_ANDROID_TRACKER_VERSION }}" ] ; then
echo "Tag version (${{ steps.version.outputs.TAG_VERSION }}) doesn't match version in project(android) (${{ steps.version.outputs.RN_ANDROID_TRACKER_VERSION }})"
exit 1
fi
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Version 1.1.0 (2022-02-07)
--------------------------
Update mobile tracker dependencies to v3 (#141)
Add deep link and message notification events (#142)
Update demo app to show accessing tracker instance from platform native code (#136)
Fix compilation error for iOS build on ARM macs (#140)
Fix check for byteLimitGet when reading emitter configuration (#138)
Fix check for Android version in GitHub Actions (#134)
Update year in all copyright notices (#148)
Update dependencies (#150)

Version 1.0.0 (2021-08-09)
--------------------------
Fix action-gh-release to specific commit (#133)
Expand Down
53 changes: 53 additions & 0 deletions DemoApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,43 @@ const App = () => {
});
};

const onPressTrackDeepLinkReceivedEvent = () => {
tracker.trackDeepLinkReceivedEvent({
url: 'https://deeplink.com',
referrer: 'http://refr.com',
});
};

const onPressTrackMessageNotificationEvent = () => {
tracker.trackMessageNotificationEvent({
title: 'title1',
body: 'body1',
trigger: 'push',
action: 'action1',
attachments: [
{
identifier: 'att_id1',
type: 'att_type1',
url: 'http://att.url.1',
},
],
bodyLocArgs: ['bodyArg1', 'bodyArg2'],
bodyLocKey: 'bodyKey1',
category: 'category1',
contentAvailable: true,
group: 'group1',
icon: 'icon1',
notificationCount: 3,
notificationTimestamp: '2022-02-02T15:17:42.767Z',
sound: 'sound1',
subtitle: 'subtitle1',
tag: 'tag1',
threadIdentifier: 'threadIdentifier1',
titleLocArgs: ['titleArg1', 'titleArg2'],
titleLocKey: 'titleKey1',
});
};

const onPressShowMeSomeWarnings = () => {
tracker.trackSelfDescribingEvent({});
tracker.trackStructuredEvent({});
Expand Down Expand Up @@ -354,6 +391,22 @@ const App = () => {
accessibilityLabel="testPageView"
/>
</Section>
<Section title="Deep Link">
<Button
onPress={onPressTrackDeepLinkReceivedEvent}
title="Track a Deep Link Received Event"
color="#841584"
accessibilityLabel="testDeepLinkReceived"
/>
</Section>
<Section title="Message Notification">
<Button
onPress={onPressTrackMessageNotificationEvent}
title="Track a Message Notification Event"
color="#841584"
accessibilityLabel="testMessageNotification"
/>
</Section>
<Section title="Second tracker">
<Button
onPress={onPressTestSecondTracker}
Expand Down
2 changes: 2 additions & 0 deletions DemoApp/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ dependencies {
} else {
implementation jscFlavor
}

implementation 'com.snowplowanalytics:snowplow-android-tracker:3.+'
}

// Run this once to be able to run the application with BUCK
Expand Down
13 changes: 13 additions & 0 deletions DemoApp/android/app/src/main/java/com/demoapp/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.demoapp;

import android.view.KeyEvent;

import com.facebook.react.ReactActivity;
import com.snowplowanalytics.snowplow.Snowplow;
import com.snowplowanalytics.snowplow.event.Structured;

public class MainActivity extends ReactActivity {

Expand All @@ -12,4 +16,13 @@ public class MainActivity extends ReactActivity {
protected String getMainComponentName() {
return "DemoApp";
}

/**
* Demonstrates the use of a tracker initialized in React native.
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
Snowplow.getDefaultTracker().track(new Structured("key", "press"));
return super.onKeyDown(keyCode, event);
}
}
128 changes: 69 additions & 59 deletions DemoApp/ios/DemoApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion DemoApp/ios/DemoApp/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#import "AppDelegate.h"
#import "ViewController.h"

#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#endif

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
Expand Down Expand Up @@ -32,6 +37,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
#endif

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]];
#endif
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"DemoApp"
initialProperties:nil];
Expand All @@ -43,7 +51,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
}

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
ViewController *rootViewController = [ViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
Expand Down
16 changes: 16 additions & 0 deletions DemoApp/ios/DemoApp/ViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// ViewController.h
// DemoApp
//
// Created by Matus Tomlein on 19/01/2022.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface ViewController : UIViewController

@end

NS_ASSUME_NONNULL_END
33 changes: 33 additions & 0 deletions DemoApp/ios/DemoApp/ViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// ViewController.m
// DemoApp
//
// Created by Matus Tomlein on 19/01/2022.
//

#import "ViewController.h"
#import "SPSnowplow.h"
#import "SPStructured.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
}

/**
Demonstrates the use of a tracker initialized in React native.
*/
- (void)pressesBegan:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
{
id<SPTrackerController> tracker = [SPSnowplow defaultTracker];
SPStructured *structured = [[SPStructured alloc] initWithCategory:@"key" action:@"press"];
[tracker track:structured];
[super pressesBegan:presses withEvent:event];
}

@end
6 changes: 5 additions & 1 deletion DemoApp/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ target 'DemoApp' do
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
use_flipper!({'Flipper' => '0.132.0', 'Flipper-Folly' => '2.6.10', 'Flipper-RSocket' => '1.4.3'})

post_install do |installer|
react_native_post_install(installer)

installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
Loading

0 comments on commit 8cb037b

Please sign in to comment.