Skip to content

Commit 63e0d99

Browse files
committed
v14.0.5
1 parent f31969d commit 63e0d99

File tree

9 files changed

+94
-72
lines changed

9 files changed

+94
-72
lines changed

android/build.gradle

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

5757
dependencies {
5858
implementation "com.facebook.react:react-native:+"
59-
implementation group: 'io.gleap', name: 'gleap-android-sdk', version: '14.0.2'
59+
implementation group: 'io.gleap', name: 'gleap-android-sdk', version: '14.0.5'
6060

6161
if(rootProject && rootProject.ext) {
6262
if(rootProject.ext.targetSdkVersion == 30 || rootProject.ext.compileSdkVersion == 30) {

android/src/main/java/com/reactnativegleapsdk/GleapsdkModule.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,13 @@ public void invoke(int count) {
197197

198198
Gleap.getInstance().registerCustomAction(new CustomActionCallback() {
199199
@Override
200-
public void invoke(String message) {
200+
public void invoke(String message, String shareToken) {
201201
JSONObject obj = new JSONObject();
202202
try {
203203
obj.put("name", message);
204+
if (shareToken != null) {
205+
obj.put("shareToken", shareToken);
206+
}
204207
} catch (JSONException e) {
205208
e.printStackTrace();
206209
}

example/index.js

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,36 @@
22
* @format
33
*/
44

5-
import { AppRegistry } from 'react-native';
5+
import {AppRegistry} from 'react-native';
66
import App from './App';
7-
import { name as appName } from './app.json';
7+
import {name as appName} from './app.json';
88
import Gleap from 'react-native-gleapsdk';
99

1010
const transactionTool = {
11-
// Name the tool. Only lowecase letters and - are allowed.
12-
name: 'send-money',
13-
// Describe the tool. This can also contain further instructions for the LLM.
14-
description: 'Send money to a given contact.',
15-
// Let the LLM know what the tool is doing. This will allow Kai to update the customer accordingly.
16-
response: 'The transfer got initiated but not completed yet. The user must confirm the transfer in the banking app.',
17-
// Specify the parameters (it's also possible to pass an empty array)
18-
parameters: [{
19-
name: 'amount',
20-
description: 'The amount of money to send. Must be positive and provided by the user.',
21-
type: 'number',
22-
required: true
23-
}, {
24-
name: 'contact',
25-
description: 'The contact to send money to.',
26-
type: 'string',
27-
enum: ["Alice", "Bob"], // Optional
28-
required: true
29-
}]
11+
// Name the tool. Only lowecase letters and - are allowed.
12+
name: 'send-money',
13+
// Describe the tool. This can also contain further instructions for the LLM.
14+
description: 'Send money to a given contact.',
15+
// Let the LLM know what the tool is doing. This will allow Kai to update the customer accordingly.
16+
response:
17+
'The transfer got initiated but not completed yet. The user must confirm the transfer in the banking app.',
18+
// Specify the parameters (it's also possible to pass an empty array)
19+
parameters: [
20+
{
21+
name: 'amount',
22+
description:
23+
'The amount of money to send. Must be positive and provided by the user.',
24+
type: 'number',
25+
required: true,
26+
},
27+
{
28+
name: 'contact',
29+
description: 'The contact to send money to.',
30+
type: 'string',
31+
enum: ['Alice', 'Bob'], // Optional
32+
required: true,
33+
},
34+
],
3035
};
3136

3237
// Add all available tools to the array.
@@ -35,20 +40,24 @@ const tools = [transactionTool];
3540
// Set the AI tools.
3641
Gleap.setAiTools(tools);
3742

38-
Gleap.setTicketAttribute("note", "This is a test value.");
43+
Gleap.setTicketAttribute('note', 'This is a test value.');
3944

40-
Gleap.initialize('qL1QaYaBwCZ7rweHFTT9zROoBkZNhM8w');
45+
Gleap.initialize('nKT6erqDUjwqfVN2xRkOG4XOf8NEEJ52');
4146

42-
Gleap.registerListener('toolExecution', (data) => {
43-
console.log("data", data);
47+
Gleap.registerCustomAction(customAction => {
48+
console.log('customAction', JSON.stringify(customAction, null, 2));
4449
});
4550

46-
Gleap.registerListener('outboundSent', (data) => {
47-
console.log("outboundSent", data);
51+
Gleap.registerListener('toolExecution', data => {
52+
console.log('data', data);
4853
});
4954

50-
Gleap.registerListener('feedbackSent', (data) => {
51-
console.log("feedbackSent", data);
55+
Gleap.registerListener('outboundSent', data => {
56+
console.log('outboundSent', data);
57+
});
58+
59+
Gleap.registerListener('feedbackSent', data => {
60+
console.log('feedbackSent', data);
5261
});
5362

5463
AppRegistry.registerComponent(appName, () => App);

example/ios/Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ PODS:
1010
- React-jsi (= 0.71.11)
1111
- ReactCommon/turbomodule/core (= 0.71.11)
1212
- fmt (6.2.1)
13-
- Gleap (14.0.1)
13+
- Gleap (14.0.5)
1414
- glog (0.3.5)
1515
- hermes-engine (0.71.11):
1616
- hermes-engine/Pre-built (= 0.71.11)
@@ -267,8 +267,8 @@ PODS:
267267
- React-jsinspector (0.71.11)
268268
- React-logger (0.71.11):
269269
- glog
270-
- react-native-gleapsdk (14.0.2):
271-
- Gleap (= 14.0.1)
270+
- react-native-gleapsdk (14.0.5):
271+
- Gleap (= 14.0.5)
272272
- React-Core
273273
- React-perflogger (0.71.11)
274274
- React-RCTActionSheet (0.71.11):
@@ -479,7 +479,7 @@ SPEC CHECKSUMS:
479479
FBLazyVector: c511d4cd0210f416cb5c289bd5ae6b36d909b048
480480
FBReactNativeSpec: a911fb22def57aef1d74215e8b6b8761d25c1c54
481481
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
482-
Gleap: b1911c1a804fbccdd77e83677d03be395675668d
482+
Gleap: 5d885579f3f8b9f462dc92d1b802a741f47aee88
483483
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
484484
hermes-engine: 34c863b446d0135b85a6536fa5fd89f48196f848
485485
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
@@ -497,7 +497,7 @@ SPEC CHECKSUMS:
497497
React-jsiexecutor: 18b5b33c5f2687a784a61bc8176611b73524ae77
498498
React-jsinspector: b6ed4cb3ffa27a041cd440300503dc512b761450
499499
React-logger: 186dd536128ae5924bc38ed70932c00aa740cd5b
500-
react-native-gleapsdk: b361efd2e23a5dd57d732b7e7bc0d04cbf6b0ea7
500+
react-native-gleapsdk: 85e64405e286888832b5e47d70194a7ccd51b960
501501
React-perflogger: e706562ab7eb8eb590aa83a224d26fa13963d7f2
502502
React-RCTActionSheet: 57d4bd98122f557479a3359ad5dad8e109e20c5a
503503
React-RCTAnimation: ccf3ef00101ea74bda73a045d79a658b36728a60

example/package-lock.json

Lines changed: 38 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ios/Gleapsdk.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,11 @@ - (void)outboundSent:(NSDictionary *)data {
151151
}
152152
}
153153

154-
- (void)customActionCalled:(NSString *)customAction {
154+
- (void)customActionCalled:(NSString *)customAction withShareToken:(NSString *)shareToken {
155155
if (_hasListeners) {
156156
[self sendEventWithName:@"customActionTriggered" body:@{
157-
@"name": customAction
157+
@"name": customAction,
158+
@"shareToken": shareToken
158159
}];
159160
}
160161
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-gleapsdk",
3-
"version": "14.0.4",
3+
"version": "14.0.5",
44
"description": "Know exactly why and how a bug happened. Get reports with screenshots, live action replays and all of the important metadata every time.",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

react-native-gleapsdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
1616
s.source_files = "ios/**/*.{h,m,mm}"
1717

1818
s.dependency "React-Core"
19-
s.dependency "Gleap", "14.0.2"
19+
s.dependency "Gleap", "14.0.5"
2020
end

src/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ type GleapSdkType = {
9999
stopNetworkLogging(): void;
100100
setActivationMethods(activationMethods: GleapActivationMethod[]): void;
101101
registerCustomAction(
102-
customActionCallback: (data: { name: string }) => void
102+
customActionCallback: (data: { name: string; shareToken?: string }) => void
103103
): void;
104104
getIdentity(): Promise<any>;
105105
isUserIdentified(): Promise<boolean>;
@@ -276,10 +276,11 @@ if (GleapSdk && !GleapSdk.touched) {
276276
if (isJsonString(data)) {
277277
data = JSON.parse(data);
278278
}
279-
const { name } = data;
279+
const { name, shareToken } = data;
280280
if (name) {
281281
notifyCallback('customActionTriggered', {
282282
name,
283+
shareToken,
283284
});
284285
}
285286
} catch (exp) {}

0 commit comments

Comments
 (0)