Skip to content

Commit

Permalink
Merge pull request #120 from apptentive/develop
Browse files Browse the repository at this point in the history
Release 5.5.1
  • Loading branch information
frankus authored Jul 8, 2020
2 parents ddea74c + 27bf799 commit 49a134c
Show file tree
Hide file tree
Showing 29 changed files with 398 additions and 445 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ build/
.gradle
local.properties
*.iml
captures/

# BUCK
buck-out/
\.buckd/
*.keystore

# CocoaPods
Pods
Pods

.vscode
63 changes: 63 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
addons:
artifacts:
paths:
- ./sample61/android/captures/*

jobs:
include:
- stage: e2e
os: osx
language: objective-c
cache:
bundler: true
cocoapods: true
npm: true
pip: true
osx_image: xcode11.2
before_install:
- gem install cocoapods -v '0.32.1'
install:
- npm install
- cd sample61
- npm install
- cd ios
- pod install
- cd ..
script:
- npx react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
- xcodebuild -workspace ios/sample61.xcworkspace/ -scheme sample61 -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11' clean build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
- stage: e2e
os: linux
language: android
dist: trusty
android:
components:
# Project
- tools
- platform-tools
- build-tools-28.0.3
- android-28
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository

# Emulator
- android-24
- sys-img-armeabi-v7a-android-24
licenses: ".+"
before_install:
- nvm install 12
install: skip
before_script:
- echo no | android create avd --force -n test -t android-24 --abi armeabi-v7a -c 100M
- emulator -avd test -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- node --version
- cd sample61
- npm install
- mkdir -p android/app/src/main/assets
- npx react-native bundle --entry-file index.js --platform android --dev false --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
- cd android
- ./gradlew assembleAndroidTest
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ This document lets you know what has changed in the React Native module. For cha
- [Android Changelog](https://github.com/apptentive/apptentive-android/blob/master/CHANGELOG.md)
- [iOS Changelog](https://github.com/apptentive/apptentive-ios/blob/master/CHANGELOG.md)

# 2020-07-08 - v5.5.1

- Apptentive Android SDK: 5.5.3
- Apptentive iOS SDK: 5.2.14

# 2019-11-14 - v5.5.0

- Fixed React Native `0.60.+` incompatibility on Android. For more information: https://learn.apptentive.com/knowledge-base/react-native-integration-reference/#migrating-from-support-library-to-androidx
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ repositories {

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'com.apptentive:apptentive-android:5.5.0'
implementation 'com.apptentive:apptentive-android:5.5.3'
}
2 changes: 1 addition & 1 deletion android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="apptentive_distribution">React Native</string>
<string name="apptentive_distribution_version">5.5.0</string>
<string name="apptentive_distribution_version">5.5.1</string>
</resources>
2 changes: 1 addition & 1 deletion apptentive-react-native.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "apptentive-react-native"
s.version = "5.4.6"
s.version = "5.5.1"
s.summary = "Apptentive SDK module for React Native"

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion ios/RNApptentiveModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ - (dispatch_queue_t)methodQueue
if (configuration) {
configuration.appID = configurationDictionary[@"appleID"];
configuration.distributionName = @"React Native";
configuration.distributionVersion = @"5.5.0";
configuration.distributionVersion = @"5.5.1";
[Apptentive registerWithConfiguration:configuration];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(messageCenterUnreadCountChangedNotification:) name:ApptentiveMessageCenterUnreadCountChangedNotification object:nil];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apptentive-react-native",
"version": "5.5.0",
"version": "5.5.1",
"description": "React Native Module for Apptentive SDK",
"main": "js/index.js",
"types": "js/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion sample/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ target 'sample' do
use_frameworks!

# Pods for sample
pod 'apptentive-ios', '5.2.7'
pod 'apptentive-ios', '5.2.14'

end
12 changes: 6 additions & 6 deletions sample/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- apptentive-ios (5.2.7)
- apptentive-ios (5.2.14)

DEPENDENCIES:
- apptentive-ios (= 5.2.7)
- apptentive-ios (= 5.2.14)

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
trunk:
- apptentive-ios

SPEC CHECKSUMS:
apptentive-ios: fc0c29a9599737240b5fe93d10d2a90150fb6b7a
apptentive-ios: 16951b1f9546bbae9165792679f865dc53bbe82f

PODFILE CHECKSUM: 3b112418f2faa6ed3cde7a7ee73502794a46f47c
PODFILE CHECKSUM: 6054e413be9c8c5ca4dd0d946a9d8e08124d4257

COCOAPODS: 1.8.4
COCOAPODS: 1.9.3
4 changes: 2 additions & 2 deletions sample61/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ class App extends React.Component {
}

componentDidMount() {
if (!credentials.apptentiveKey || credentials.apptentiveKey === '___YOUR_IOS_APPTENTIVE_KEY___' || credentials.apptentiveKey === '___YOUR_ANDROID_APPTENTIVE_KEY___') {
if (!credentials.apptentiveKey) {
showAlert('Error', 'Please, provide Apptentive Key');
return;
}

if (!credentials.apptentiveSignature || credentials.apptentiveSignature === '___YOUR_IOS_APPTENTIVE_SIGNATURE___' || credentials.apptentiveSignature === '___YOUR_ANDROID_APPTENTIVE_SIGNATURE___') {
if (!credentials.apptentiveSignature) {
showAlert('Error', 'Please, provide Apptentive Signature');
return;
}
Expand Down
16 changes: 16 additions & 0 deletions sample61/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Sample Setup

Ensure you have updated `App.js` with your key / signature.

Generate the bundle:

```shell
npx react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
npx react-native bundle --entry-file index.js --platform android --dev false --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
```

Test the UI, adjust the destination name and OS to fit your needs:

```shell
xcodebuild -workspace ios/sample61.xcworkspace/ -scheme sample61 -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11,OS=13.2.2' clean build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
```
7 changes: 7 additions & 0 deletions sample61/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
splits {
abi {
Expand Down Expand Up @@ -189,6 +191,11 @@ dependencies {
} else {
implementation jscFlavor
}

androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

androidTestImplementation 'androidx.test:rules:1.1.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
}

// Run this once to be able to run the application with BUCK
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.sample61;

import android.view.View;
import android.widget.TextView;

import org.hamcrest.Matcher;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import androidx.test.espresso.DataInteraction;
import androidx.test.espresso.Root;
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import androidx.test.rule.ActivityTestRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.clearText;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.RootMatchers.isDialog;
import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.not;

@RunWith(AndroidJUnit4.class)
public class ChangeTextBehaviorTest {
@Rule
public ActivityTestRule<MainActivity> activityRule
= new ActivityTestRule<>(MainActivity.class);

@Before
public void initValidString() {
// TODO: Replace with idler
try {
Thread.sleep(30000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}

public String getText(final Matcher<View> matcher) {
final String[] stringHolder = { null };
onView(matcher).perform(new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isAssignableFrom(TextView.class);
}

@Override
public String getDescription() {
return "getting text from a TextView";
}

@Override
public void perform(UiController uiController, View view) {
TextView tv = (TextView)view;
stringHolder[0] = tv.getText().toString();
}
});
return stringHolder[0];
}

@Test
public void canShowInteraction() {
onView(withContentDescription("input-event-name"))
.perform(clearText())
.perform(typeText("test"));

// onView(withContentDescription("button-can-show-interaction"))
// .check(matches(isDisplayed()))
// .perform(click());

// onView(withId(android.R.id.message))
// .inRoot(isDialog())
// .check(matches(withText(endsWith("true"))));

// onView(withId(android.R.id.button1))
// .inRoot(isDialog())
// .perform(click());
}
}
2 changes: 1 addition & 1 deletion sample61/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
classpath('com.android.tools.build:gradle:3.5.2')

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
10 changes: 0 additions & 10 deletions sample61/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,3 @@ target 'sample61' do

use_native_modules!
end

target 'sample61-tvOS' do
# Pods for sample61-tvOS

target 'sample61-tvOSTests' do
inherit! :search_paths
# Pods for testing
end

end
2 changes: 1 addition & 1 deletion sample61/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,6 @@ SPEC CHECKSUMS:
ReactCommon: a6a294e7028ed67b926d29551aa9394fd989c24c
Yoga: ba3d99dbee6c15ea6bbe3783d1f0cb1ffb79af0f

PODFILE CHECKSUM: 5f5a4918d6972b0d5c916d6597369031142e3951
PODFILE CHECKSUM: 22988c2207567a6eddc8fc72f7d82661d162b93a

COCOAPODS: 1.8.4
4 changes: 4 additions & 0 deletions sample61/ios/assets/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "sample61",
"displayName": "sample61"
}
Loading

0 comments on commit 49a134c

Please sign in to comment.