Skip to content

Commit

Permalink
Merge pull request #206 from CleverTap/develop
Browse files Browse the repository at this point in the history
Release 0.8.0
  • Loading branch information
piyush-kukadiya authored Jan 17, 2022
2 parents a3d04b8 + 0ee844b commit 52f0de2
Show file tree
Hide file tree
Showing 17 changed files with 1,341 additions and 1,190 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build/
.idea
.gradle
local.properties
Example/android/app/google-services.json
*.iml

# Node
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Example
.idea
Starter
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Change Log
==========

Version 0.8.0 *(17th January 2022)*
-------------------------------------------
- Supports [CleverTap Android SDK v4.4.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/core-v4.4.0)

Version 0.7.0 *(30th November 2021)*
-------------------------------------------
- Supports CleverTap Android SDK `v4.3.1` backing Android 12
Expand Down
53 changes: 48 additions & 5 deletions Example/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { Component } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

import {
Alert,
Expand All @@ -16,6 +18,7 @@ import {
} from 'react-native';

const CleverTap = require('clevertap-react-native');
const Stack = createNativeStackNavigator();

class Expandable_ListView extends Component {

Expand Down Expand Up @@ -56,7 +59,7 @@ class Expandable_ListView extends Component {

//In this Function You can write the items to be called w.r.t list id:
show_Selected_Category = (item) => {
switch (item) {
switch (item.id) {
case 1:
set_userProfile();
break;
Expand Down Expand Up @@ -230,23 +233,45 @@ class Expandable_ListView extends Component {
GetCleverTapAttributionIdentifier();
break;
case 49:
CleverTap.setOptOut(value);
CleverTap.setOptOut(false);
break;
case 50:
CleverTap.enableDeviceNetworkInfoReporting(value);
CleverTap.enableDeviceNetworkInfoReporting(true);
break;
case 51:
CleverTap.enablePersonalization();
break;
case 52:
CleverTap.setOffline(value);
CleverTap.setOffline(false);
break;
case 53:
addCleverTapAPIListeners(true);
break;
case 54:
removeCleverTapAPIListeners();
break;
case 60:
case 61:
case 62:
case 63:
case 64:
case 65:
case 66:
case 67:
case 68:
case 69:
case 690:
case 691:
case 692:
case 693:
case 694:
case 695:
case 696:
case 697:
case 698:
CleverTap.recordEvent(item.name);
break;

}
}

Expand All @@ -272,7 +297,7 @@ class Expandable_ListView extends Component {

<TouchableOpacity key={key} style={styles.sub_Category_Text}

onPress={this.show_Selected_Category.bind(this, item.id)}>
onPress={this.show_Selected_Category.bind(this, item)}>

<Text style={styles.setSubCategoryFontSizeOne}> {item.name} </Text>

Expand Down Expand Up @@ -447,6 +472,21 @@ export default class App extends Component {
id: 54,
name: 'removeCleverTapAPIListeners'
}]
},
{
expanded: false,
category_Name: "Push Templates",
sub_Category: [{ id: 60, name: 'Send Basic Push' }, { id: 61, name: 'Send Carousel Push'},
{ id: 62, name: 'Send Manual Carousel Push' }, { id: 63, name: 'Send Filmstrip Carousel Push' },
{ id: 64, name: 'Send Rating Push' }, { id: 65, name: 'Send Product Display Notification' },
{ id: 66, name: 'Send Linear Product Display Push' }, { id: 67, name: 'Send CTA Notification' },
{ id: 68, name: 'Send Zero Bezel Notification' }, { id: 69, name: 'Send Zero Bezel Text Only Notification' },
{ id: 690, name: 'Send Timer Notification' }, { id: 691, name: 'Send Input Box Notification' },
{ id: 692, name: 'Send Input Box Reply with Event Notification' }, { id: 693, name: 'Send Input Box Reply with Auto Open Notification' },
{ id: 694, name: 'Send Input Box Remind Notification DOC FALSE' }, { id: 695, name: 'Send Input Box CTA DOC true' },
{ id: 696, name: 'Send Input Box CTA DOC false' }, { id: 697, name: 'Send Input Box Reminder DOC true' },
{ id: 698, name: 'Send Input Box Reminder DOC false' }
]
}

];
Expand Down Expand Up @@ -557,6 +597,7 @@ pushevent = () => {

//Recording an Event
CleverTap.recordEvent('testEvent');
CleverTap.recordEvent('Send Basic Push');
CleverTap.recordEvent('testEventWithProps', { 'start': new Date(), 'foo': 'bar' });
};

Expand Down Expand Up @@ -664,6 +705,8 @@ create_NotificationChannel = () => {
alert('Notification Channel Created');
//Creating Notification Channel
CleverTap.createNotificationChannel("CtRNS", "Clever Tap React Native Testing", "CT React Native Testing", 1, true);
CleverTap.createNotificationChannel("BRTesting", "Clever Tap BR Testing", "CT BR Testing", 1, true);
CleverTap.createNotificationChannel("PTTesting", "Clever Tap PT Testing", "CT PT Testing", 1, true);

};
delete_NotificationChannel = () => {
Expand Down
5 changes: 3 additions & 2 deletions Example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,12 @@ dependencies {
implementation "com.facebook.react:react-native:+" // From node_modules

//added from atlasian doc
implementation 'com.clevertap.android:clevertap-android-sdk:4.3.1'
implementation 'com.clevertap.android:clevertap-android-sdk:4.4.0'
implementation "com.clevertap.android:push-templates:1.0.0"
// implementation 'com.google.android.gms:play-services-ads:19.0.1'
implementation 'com.google.android.gms:play-services-base:17.6.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'com.google.firebase:firebase-messaging:20.2.4'
implementation 'com.google.firebase:firebase-messaging:21.0.0'
implementation project(':clevertap-react-native')
//added from atlasian doc
implementation 'com.github.bumptech.glide:glide:4.12.0' //Mandatory for App Inbox
Expand Down
39 changes: 0 additions & 39 deletions Example/android/app/google-services.json

This file was deleted.

44 changes: 37 additions & 7 deletions Example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,49 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="ctdemo"
android:host="${applicationId}"
android:pathPrefix="/MainActivity"/>

</intent-filter>
</activity>
<!-- <service android:name="com.clevertap.android.sdk.FcmTokenListenerService">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>-->
<!-- </intent-filter>-->
<!-- </service>-->
<activity
android:name=".WebViewActivity"
android:exported="true"
android:label="WebView">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- If a user clicks on a shared link that uses the "http" scheme, your
app should be able to delegate that traffic to "https". -->
<data
android:host="com.clevertap.demo"
android:pathPrefix="/WebViewActivity"
android:scheme="ctdemo" />

</intent-filter>
</activity>
<service android:name=".MyFirebaseMessagingService" android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<meta-data android:name="CLEVERTAP_ACCOUNT_ID" android:value="88R-R54-5Z6Z" />
<meta-data android:name="CLEVERTAP_TOKEN" android:value="452-2bb" />
<service
android:name="com.clevertap.android.sdk.pushnotification.CTNotificationIntentService"
android:exported="false">
<intent-filter>
<action android:name="com.clevertap.PUSH_EVENT" />
</intent-filter>
</service>
<meta-data android:name="CLEVERTAP_ACCOUNT_ID" android:value="TEST-R78-ZZK-955Z" />
<meta-data android:name="CLEVERTAP_TOKEN" android:value="TEST-311-ba2" />
<meta-data android:name="CLEVERTAP_USE_GOOGLE_AD_ID" android:value="1"/>
</application>

Expand Down
36 changes: 12 additions & 24 deletions Example/android/app/src/main/java/com/reactnct/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
package com.reactnct;

import android.os.Bundle;

import com.clevertap.android.sdk.CleverTapAPI;
import com.clevertap.react.CleverTapModule;
import com.facebook.react.ReactActivity;


import java.util.List;


public class MainActivity<packages> extends ReactActivity {

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "Example";
}

protected void onCreate(Bundle savedInstanceState) {
// CleverTapAPI ct = CleverTapAPI.getDefaultInstance(getApplicationContext());


super.onCreate(savedInstanceState);

// CleverTapModule.setInitialUri(getIntent().getData());
}

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "Example";
}

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}


}
Loading

0 comments on commit 52f0de2

Please sign in to comment.