Skip to content

Commit

Permalink
Merge pull request #133 from Instabug/release/11.0.0
Browse files Browse the repository at this point in the history
[MOB-9110] Release/11.0.0
  • Loading branch information
Alwahsh authored Jul 7, 2022
2 parents f457e68 + 887c98a commit 45ddbde
Show file tree
Hide file tree
Showing 552 changed files with 4,003 additions and 51,223 deletions.
155 changes: 59 additions & 96 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,136 +1,99 @@
version: 2
version: 2.1

orbs:
android: circleci/android@2.0

jobs:
android_tests:
working_directory: ~/project
macos:
xcode: "9.4.0"
environment:
JVM_OPTS: -Xmx3200m

test_android:
working_directory: ~/project/example
executor:
name: android/android-machine
resource-class: xlarge
tag: 2022.04.1
steps:
- checkout:
path: ~/project
- run:
name: Setup environment variables
command: |
echo 'export PATH="$PATH:/usr/local/opt/node@8/bin:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin:/usr/local/share/android-sdk/tools/bin"' >> $BASH_ENV
echo 'export ANDROID_HOME="/usr/local/share/android-sdk"' >> $BASH_ENV
echo 'export ANDROID_SDK_HOME="/usr/local/share/android-sdk"' >> $BASH_ENV
echo 'export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"' >> $BASH_ENV
echo 'export QEMU_AUDIO_DRV=none' >> $BASH_ENV
echo 'export JAVA_HOME=/Library/Java/Home' >> $BASH_ENV
echo 'export PATH="$PATH:`pwd`/flutter/bin"' >> $BASH_ENV
echo "export PATH=\$PATH:/usr/local/share/android-sdk/platform-tools/" >>$BASH_ENV
- run:
name: Install Android sdk
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install --cask android-sdk
- run:
name: Install Gradle
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install gradle
no_output_timeout: 30m
- run:
name: Install emulator dependencies
command: (yes | sdkmanager "platform-tools" "platforms;android-26" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;26.0.0" "system-images;android-26;google_apis;x86" "emulator" --verbose) || true
- run: avdmanager create avd -n Pixel_2_API_26 -k "system-images;android-26;google_apis;x86" -g google_apis -d "Nexus 5"
- run:
name: Run emulator in background
command: /usr/local/share/android-sdk/tools/emulator @Pixel_2_API_26 -noaudio -no-boot-anim -no-window
background: true
- run:
name: download Cordova
name: Install Cordova CLI
command: npm install -g cordova
- run:
name: Copy sampleApp
command: cp -a sampleApp ../
- run:
name: chmod permissions
command: cd ../; chmod -R 777 sampleApp
- run:
name: Npm Install
command: cd ../sampleApp; npm install
- run:
name: Add Instabug
command: cd ../sampleApp; cordova plugin add ../project
- run:
name: Build App
command: cd ../sampleApp; cordova build android
name: Install Android Platform
command: cordova platform add android || true
- run:
name: Download Android Dependencies
command: cd ../sampleApp/platforms/android; ./gradlew androidDependencies
- run:
name: Disable animations
command: |
adb shell settings put global window_animation_scale 0.0
adb shell settings put global transition_animation_scale 0.0
adb shell settings put global animator_duration_scale 0.0
adb shell settings put secure long_press_timeout 1500
name: Install Plugins
command: cordova plugins add --link ../ tests
- run:
name: Run unit Tests
command: cd ../sampleApp/platforms/android; ./gradlew test
# - run:
# name: Run UI Tests
# command: cd ../sampleApp/platforms/android; ./gradlew app:connectedAndroidTest
name: Install Build Tools v30.0.3
command: sdkmanager "build-tools;30.0.3"
- android/start-emulator-and-run-tests:
run-tests-working-directory: platforms/android
system-image: system-images;android-30;google_apis;x86
additional-avd-args: -d "Nexus 5"
post-emulator-launch-assemble-command: cordova build android
test-command: ./gradlew app:connectedAndroidTest
- android/run-tests:
working-directory: platforms/android
test-command: ./gradlew test

ios_tests:
test_ios:
working_directory: ~/project/example
macos:
xcode: "10.2.0"
working_directory: ~/project
environment:
FL_OUTPUT_DIR: output
xcode: 13.3.0
steps:
- checkout:
path: ~/project
- run:
name: download Cordova
name: Install Cordova CLI
command: npm install -g cordova
- run:
name: Copy sampleApp
command: cp -a sampleApp ../
name: Install iOS Platform
command: cordova platform add ios || true
- run:
name: chmod permissions
command: cd ../; chmod -R 777 sampleApp
- run:
name: Npm Install
command: cd ../sampleApp; npm install
- run:
name: Add Instabug
command: cd ../sampleApp; cordova plugin add ../project
- run:
name: Build App
command: cd ../sampleApp; cordova build ios
name: Install Plugins
command: cordova plugins add --link ../ tests
- run:
name: Build and run tests
command: cd ../sampleApp/platforms/ios; xcodebuild -workspace HelloCordova.xcworkspace -scheme HelloCordova -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X,OS=12.2' test | xcpretty
name: Build iOS App
command: cordova build ios
- run:
name: Run Tests
working_directory: platforms/ios
command: |
xcodebuild -allowProvisioningUpdates \
-workspace InstabugExample.xcworkspace \
-scheme InstabugExample \
-sdk iphonesimulator \
-destination 'name=iPhone 12 Pro Max' \
test | xcpretty
publish:
publish:
macos:
xcode: "10.1.0"
xcode: 13.3.0
working_directory: "~"
steps:
- checkout
- run: git clone https://InstabugCI:$RELEASE_GITHUB_TOKEN@github.com/Instabug/Escape.git
- run: cd Escape; swift build -c release -Xswiftc -static-stdlib
- run: cd Escape/.build/release; cp -f Escape /usr/local/bin/escape
- run: cd Escape && swift build -c release
- run: cd Escape/.build/release && cp -f Escape /usr/local/bin/escape
- run: Escape cordova publish

workflows:
version: 2
publish:
build-test-and-approval-deploy:
jobs:
- android_tests
- ios_tests
- test_android
- test_ios
- hold:
type: approval
requires:
- android_tests
- ios_tests
- test_android
- test_ios
filters:
branches:
only: master
- publish:
context: cross-platform
requires:
- hold
filters:
branches:
only: master

5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@

local.properties
node_modules/

#sample-app
sample-app/.idea
sample-app/hooks/
sample-app/plugins/
Binary file removed .gradle/5.4/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/5.4/fileHashes/fileHashes.lock
Binary file not shown.
Empty file removed .gradle/5.4/gc.properties
Empty file.
Binary file removed .gradle/6.3/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/6.3/fileHashes/fileHashes.lock
Binary file not shown.
Empty file removed .gradle/6.3/gc.properties
Empty file.
Binary file removed .gradle/checksums/checksums.lock
Binary file not shown.
Empty file removed .gradle/vcs-1/gc.properties
Empty file.
8 changes: 5 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Logs
logs
*.log
npm-debug.log*

.circleci/
.github/

#sample-app
sample-app/
node_modules/
example/
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## v11.0.0 (2022-07-07)

* Bumps Instabug native SDKs to v11
* Adds the ability to initialize the Android SDK from JavaScript. Check the migration guide referenced in our docs
* Improves Instabug modules import usage. Check the migration guide referenced in our docs
* Migrates Instabug iOS SDK to be installed through CocoaPods
* Moves Instabug.setVideoRecordingFloatingButtonPosition to the BugReporting module
* Adds Instabug.setString API to allow for SDK text customizations
* Replaces Instabug.setShakingThreshold with BugReporting.setShakingThresholdForAndroid
* Adds new API BugReporting.setShakingThresholdForiPhone
* Adds new API BugReporting.setShakingThresholdForiPad
* Adds new API Instabug.setWelcomeMessageMode
* Adds new API Instabug.setColorTheme
* Adds new API Instabug.setSessionProfilerEnabled
* Adds new API BugReporting.setFloatingButtonEdge
* Fixes an issue with uploading attachments in URL form on iOS
* Fixes an issue with BugReporting.setEnabledAttachmentTypes not working on Android
* Removes the deprecated APIs. Check the migration guide referenced in our docs
* Removes the Android multidex dependency
* Removes Instabug.setAutoScreenRecordingMaxDuration
* Removes Surveys.setThresholdForReshowingSurveyAfterDismiss
* Removes BugReporting.invocationModes enum


## v9.1.7 (2021-05-11)

* Adds support for Azerbaijani and Danish locales
Expand Down
55 changes: 11 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,17 @@ cordova plugin add instabug-cordova
ionic cordova plugin add instabug-cordova
```

## Android Integration Steps
## Integration Steps

1. Change the name of the application class in your AndroidManifest.xml file to `android:name="com.instabug.cordova.plugin.MyApplication"`.
- Add the following snippet to your `index.js` file inside `onDeviceReady` function:

2. You need to add your app token in the **MyApplication** class, by replacing `YOUR_ANDROID_TOKEN`. (You can find this class under this path `YourProjectName/platforms/android/app/src/main/java/com.instabug.cordova.plugin/MyApplication.java`)
```js
var Instabug = cordova.require('instabug-cordova.Instabug');
var BugReporting = cordova.require('instabug-cordova.BugReporting');

3. You can change the invocation event by changing this line `InstabugInvocationEvent.SHAKE` in the **MyApplication** class to any of the following:

`InstabugInvocationEvent.FLOATING_BUTTON`, `InstabugInvocationEvent.SCREENSHOT_GESTURE`, `InstabugInvocationEvent.TWO_FINGER_SWIPE_LEFT`, or `InstabugInvocationEvent.NONE`.

4. Make sure the following snippet is added to your project level `build.gradle`, if not you can manually add it as follows:.

```dart
allprojects {
repositories {
maven {
url "https://sdks.instabug.com/nexus/repository/instabug-cp"
}
}
}
```

⚠️ Starting from Instabug-Cordova v9, we require the `compileSdkVersion` to be set to a minimum of `29`. It can be set inside the app's `build.gradle` file as below:

android {
compileSdkVersion 29
}

## iOS Integration Steps

You can initialize the SDK by using this method in your App JS file.

```
cordova.plugins.instabug.activate(
{
ios: 'MY_IOS_TOKEN'
},
'shake',
{
commentRequired: true,
colorTheme: 'light'
},
Instabug.start(
'YOUR_CORDOVA_TOKEN',
[BugReporting.invocationEvents.button],
function () {
console.log('Instabug initialized.');
},
Expand All @@ -71,11 +40,9 @@ cordova.plugins.instabug.activate(
);
```

You can change the invocation event with any of the following: `'button'`, `'screenshot'`, `'swipe'`, or `'shake'`.

⚠️ TypeScript users, make sure you declare `cordova` at the beginning of your app class (app.component.ts):
- Replace `YOUR_CORDOVA_TOKEN` with your application token.

declare let cordova: any;
> :warning: If you're updating the SDK from versions prior to v11, please check our [migration guide](https://docs.instabug.com/docs/cordova-migration-guide).
## Features Not Yet Supported
- User steps.
Expand All @@ -89,4 +56,4 @@ You can change the invocation event with any of the following: `'button'`, `'scr

This software is released under the <a href="http://opensource.org/licenses/Apache-2.0">Apache 2.0 License</a>.

© 2016 Instabug. All rights reserved.
© 2022 Instabug. All rights reserved.
26 changes: 0 additions & 26 deletions build.gradle

This file was deleted.

15 changes: 9 additions & 6 deletions sampleApp/platforms/ios/cordova/log → example/.gitignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#! /bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand All @@ -7,17 +6,21 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd -P)
.DS_Store

# Generated by package manager
node_modules/

tail -f "$CORDOVA_PATH/console.log"
# Generated by Cordova
/plugins/
/platforms/
11 changes: 11 additions & 0 deletions example/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.instabug.example" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>InstabugExample</name>
<description>Sample Apache Cordova App</description>
<author email="dev@cordova.apache.org" href="https://cordova.apache.org">
Apache Cordova Team
</author>
<content src="index.html" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
</widget>
Loading

0 comments on commit 45ddbde

Please sign in to comment.