Skip to content

Commit 90ecbae

Browse files
Added Surveys and NPS feedback widgets. Added calls to interract with different app key requests. Added setStarRatingDialogTexts method to set text's for different fields of star rating dialog. Added setViewTracking deprecated method back. Google play vulnerability issue fixed. Travis CI added. Example app updated for IDFA and tracking changes for iOS. Device id NSNull check added for iOS. Added APM fixes. Merge pull request #36 from Countly/dev-junaid
Added Surveys and NPS feedback widgets Added replaceAllAppKeysInQueueWithCurrentAppKey method to replace all app keys in the queue with the current app key Added removeDifferentAppKeysFromQueue method to remove all different app keys from the queue Added setStarRatingDialogTexts method to set text's for different fields of star rating dialog Added setViewTracking deprecated method back. Google play vulnerability issue fixed due to broadcast receiver for android push notification Travis CI added. Example app updated with a single plugin for both IDFA and App tracking permission for iOS. Device id NSNull check added for iOS to fix the length on the null crash. Updated underlying android SDK to 20.11.0 Updated underlying ios SDK to 20.11.0 Added APM fixes for foreground/background and app start duration.
2 parents 81967b2 + b235d3b commit 90ecbae

File tree

14 files changed

+429
-90
lines changed

14 files changed

+429
-90
lines changed

.travis.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
matrix:
2+
include:
3+
- language: android
4+
sudo: false
5+
jdk: oraclejdk8
6+
os: linux
7+
dist: trusty
8+
before_cache:
9+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
10+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
11+
cache:
12+
directories:
13+
- "$HOME/.yarn-cache"
14+
- "$HOME/.gradle/caches/"
15+
- "$HOME/.gradle/wrapper/"
16+
android:
17+
components:
18+
- tools
19+
- platform-tools
20+
- build-tools-23.0.3
21+
- android-23
22+
- build-tools-28.0.3
23+
- android-28
24+
- build-tools-29.0.2
25+
- android-29
26+
- extra-google-google_play_services
27+
install:
28+
- nvm install 10
29+
- curl -o- -L https://yarnpkg.com/install.sh | bash
30+
- export PATH="$HOME/.yarn/bin:$PATH"
31+
- cd example/
32+
- chmod +x travis_common.sh
33+
- ./travis_common.sh $TRAVIS_BRANCH
34+
- cd AwesomeProject
35+
- sed -i 's/minSdkVersion = 16/minSdkVersion = 17/g' android/build.gradle
36+
- sed -ie "s/23/28/g" node_modules/react-native-advertising-id/android/build.gradle
37+
script:
38+
- cd android
39+
- "./gradlew clean"
40+
- "./gradlew app:assembleRelease"
41+
- language: objective-c
42+
os: osx
43+
osx_image: xcode12.2
44+
node_js: 8
45+
cache:
46+
directories:
47+
- "$HOME/.yarn-cache"
48+
before_install:
49+
- nvm install 10
50+
- curl -o- -L https://yarnpkg.com/install.sh | bash
51+
- export PATH="$HOME/.yarn/bin:$PATH"
52+
- cd example/
53+
- chmod +x travis_common.sh
54+
- ./travis_common.sh $TRAVIS_BRANCH
55+
- cd AwesomeProject
56+
- cd ios
57+
- pod install
58+
script:
59+
- xcodebuild -workspace AwesomeProject.xcworkspace -configuration Debug
60+
-scheme AwesomeProject -destination "platform=iOS Simulator,name=iPhone 11 Pro Max,OS=latest" -derivedDataPath build/AwesomeProject | xcpretty
61+
email:
62+
recipients:
63+
64+
on_success: change

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## 20.11.0
2+
* !! Due to cocoapods issue with Xcode 12, we have created a new temporary Pod with a fix for Countly iOS SDK and named it "CounltyPod". Due to that change if you have already add the reference of files "CountlyNotificationService.h/m" then you need to update these files references by adding the files from "CountlyPod" and remove the old reference files.
3+
* !! Consent change !! To use remote config, you now need to give "remote-config" consent
4+
* !! Push breaking changes !! Google play vulnerability issue fixed due to broadcast receiver for android push notification
5+
* Added Surveys and NPS feedback widgets
6+
* Added replaceAllAppKeysInQueueWithCurrentAppKey method to replace all app keys in queue with the current app key
7+
* Added removeDifferentAppKeysFromQueue method to remove all different app keys from the queue
8+
* Added setStarRatingDialogTexts method to set text's for different fields of star rating dialog
9+
* Added setViewTracking deprecated method back.
10+
* Example app updated with single plugin for both IDFA and App tracking permission for iOS.
11+
* Device id NSNull check added for iOS to fix the length on null crash.
12+
* Updated underlying android SDK to 20.11.0
13+
* Updated underlying ios SDK to 20.11.0
14+
115
## 20.4.9
216
* Hotfix for compilation issue
317

@@ -29,4 +43,4 @@
2943
* Tweaked android push notifications to show up only in the notification bar
3044
* Fixed SDK version and SDK name metrics to show not the bridged SDK values but the ones from the react native SDK
3145

32-
* Please refer to this documentation for released work https://support.count.ly/hc/en-us/articles/360037813231-React-Native-Bridge-
46+
* Please refer to this documentation for released work https://support.count.ly/hc/en*us/articles/360037813231*React*Native*Bridge*

Countly.js

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (Platform.OS.match("android")) {
2424
}
2525

2626
// countly initialization
27-
Countly.init = async function(serverUrl, appKey, deviceId = ""){
27+
Countly.init = async function(serverUrl, appKey, deviceId){
2828

2929
if(deviceId == "") {
3030
deviceId = null;
@@ -97,6 +97,18 @@ Countly.sendEvent = function(options){
9797
CountlyReactNative.event(args);
9898
}
9999

100+
/**
101+
* Enable or disable automatic view tracking
102+
*
103+
* @deprecated in 20.04.6
104+
*
105+
*/
106+
Countly.setViewTracking = async function(boolean) {
107+
if(await CountlyReactNative.isLoggingEnabled()) {
108+
console.log("[CountlyReactNative] setViewTracking is deprecated.");
109+
}
110+
}
111+
100112
/**
101113
* Record custom view to Countly.
102114
*
@@ -602,6 +614,20 @@ Countly.remoteConfigClearValues = async function(){
602614
const result = await CountlyReactNative.remoteConfigClearValues();
603615
return result;
604616
}
617+
/**
618+
* Set's the text's for the different fields in the star rating dialog. Set value null if for some field you want to keep the old value
619+
*
620+
* @param {String} starRatingTextTitle - dialog's title text (Only for Android)
621+
* @param {String} starRatingTextMessage - dialog's message text
622+
* @param {String} starRatingTextDismiss - dialog's dismiss buttons text (Only for Android)
623+
*/
624+
Countly.setStarRatingDialogTexts = function(starRatingTextTitle, starRatingTextMessage, starRatingTextDismiss){
625+
var args = [];
626+
args.push(starRatingTextTitle);
627+
args.push(starRatingTextMessage);
628+
args.push(starRatingTextDismiss);
629+
CountlyReactNative.setStarRatingDialogTexts(args);
630+
}
605631

606632
Countly.showStarRating = function(callback){
607633
if(!callback){callback = function(){}};
@@ -611,6 +637,24 @@ Countly.showStarRating = function(callback){
611637
Countly.showFeedbackPopup = function(widgetId, closeButtonText,){
612638
CountlyReactNative.showFeedbackPopup([widgetId.toString() || "", closeButtonText.toString() || "Done"]);
613639
}
640+
/**
641+
* Get a list of available feedback widgets for this device ID
642+
*/
643+
Countly.getAvailableFeedbackWidgets = async function(){
644+
const result = await CountlyReactNative.getAvailableFeedbackWidgets();
645+
return result;
646+
}
647+
648+
/**
649+
* Present a chosen feedback widget
650+
*
651+
* @param {String} widgetType - type of widget : "nps" or "survey"
652+
* @param {String} widgetId - id of widget to present
653+
* @param {String} closeButtonText - text for cancel/close button
654+
*/
655+
Countly.presentFeedbackWidget = function(widgetType, widgetId, closeButtonText,){
656+
CountlyReactNative.presentFeedbackWidget([widgetId.toString() || "",widgetType.toString() || "", closeButtonText.toString()]);
657+
}
614658

615659
/**
616660
*
@@ -698,13 +742,43 @@ Countly.enableAttribution = async function(attributionID = "") {
698742
* Currently implemented for iOS only
699743
* For Android just call the enableAttribution to enable campaign attribution.
700744
*/
701-
702745
Countly.recordAttributionID = function(attributionID){
703746
if (!Platform.OS.match("ios")) return "recordAttributionID : To be implemented";
704747
var args = [];
705748
args.push(attributionID);
706749
CountlyReactNative.recordAttributionID(args);
707750
}
751+
/**
752+
* Replaces all requests with a different app key with the current app key.
753+
* In request queue, if there are any request whose app key is different than the current app key,
754+
* these requests' app key will be replaced with the current app key.
755+
*/
756+
Countly.replaceAllAppKeysInQueueWithCurrentAppKey = function(){
757+
CountlyReactNative.replaceAllAppKeysInQueueWithCurrentAppKey();
758+
}
759+
/**
760+
* Removes all requests with a different app key in request queue.
761+
* In request queue, if there are any request whose app key is different than the current app key,
762+
* these requests will be removed from request queue.
763+
*/
764+
Countly.removeDifferentAppKeysFromQueue = function(){
765+
CountlyReactNative.removeDifferentAppKeysFromQueue()
766+
}
767+
768+
769+
/**
770+
* Call this function when app is loaded, so that the app launch duration can be recorded.
771+
* Should be call after init.
772+
*/
773+
Countly.appLoadingFinished = async function(){
774+
if(!await Countly.isInitialized()) {
775+
if(await CountlyReactNative.isLoggingEnabled()) {
776+
console.warn('[CountlyReactNative] appLoadingFinished, init must be called before appLoadingFinished');
777+
}
778+
return "init must be called before appLoadingFinished";
779+
}
780+
CountlyReactNative.appLoadingFinished()
781+
}
708782

709783
/*
710784
Countly.initNative = function(){

CountlyReactNative.podspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'CountlyReactNative'
3-
s.version = '20.04'
3+
s.version = '20.11.0'
44
s.license = {
55
:type => 'COMMUNITY',
66
:text => <<-LICENSE
@@ -40,11 +40,12 @@ Pod::Spec.new do |s|
4040
s.osx.deployment_target = '8.0'
4141
s.watchos.deployment_target = '2.0'
4242
s.tvos.deployment_target = '9.0'
43+
s.static_framework = true
4344

4445
s.subspec 'NotificationService' do |ns|
4546
ns.source_files = 'ios/src/CountlyNotificationService.{m,h}'
4647
end
4748

4849
s.dependency "React"
49-
s.dependency "Countly", '20.04.3'
50+
s.dependency "CountlyPod", '20.11.0'
5051
end

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ repositories {
4444

4545
dependencies {
4646
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
47-
implementation 'ly.count.android:sdk:20.04.5'
47+
implementation 'ly.count.android:sdk:20.11.1'
4848

4949
//if any version higher than 18.0.0 is used then it forces AndroidX
5050
implementation 'com.google.firebase:firebase-messaging:18.0.0'

android/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ly.count.android.sdk.react">
22

33
<uses-permission android:name="android.permission.INTERNET"/>
4-
4+
<uses-permission android:name="${applicationId}.CountlyPush.BROADCAST_PERMISSION" />
5+
<permission android:name="${applicationId}.CountlyPush.BROADCAST_PERMISSION"
6+
android:protectionLevel="signature" />
57
<application>
68
<uses-library android:name="android.test.runner"/>
79
<service android:name="ly.count.android.sdk.react.CountlyMessagingService">

0 commit comments

Comments
 (0)