Skip to content

Commit 95a9292

Browse files
authored
💎 Bump version to 8.4.1
* 🐛 fix ios getAvailableSurveys API not returning surveys for ios * 🐛 fix typescript def for the API getAvailableSurveys * 💎 Bump version to 8.4.1
1 parent 369cabc commit 95a9292

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## v8.4.1 (2019-06-17)
2+
3+
* Fixes Surveys.getAvailableSurveys API not returning the list of surveys on iOS.
4+
* Fixes typescript definition for the API Surveys.getAvailableSurveys.
5+
16
## v8.4.0 (2019-06-11)
27

38
* Updates native iOS and Android SDKs to version 8.4.

index.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export namespace Surveys {
105105
sessionCount: number,
106106
daysCount: number
107107
): void;
108-
function getAvailableSurveys(availableSurveysCallback: () => void): void;
108+
function getAvailableSurveys(availableSurveysCallback: (surveys: Survey[]) => void): void;
109109
function setAutoShowingEnabled(autoShowingSurveysEnabled: boolean): void;
110110
function onShowCallback(willShowSurveyHandler: () => void): void;
111111
function setOnShowHandler(onShowHandler: () => void): void;
@@ -375,3 +375,7 @@ export enum strings {
375375
addFileAttachmentWithUrl(url: string, filename: string);
376376
addFileAttachmentWithData(data: string, filename: string);
377377
}
378+
379+
interface Survey {
380+
title: string
381+
}

ios/RNInstabug/InstabugReactBridge.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,12 @@ - (dispatch_queue_t)methodQueue {
473473
}
474474

475475
RCT_EXPORT_METHOD(getAvailableSurveys:(RCTResponseSenderBlock)callback) {
476-
callback(@[[IBGSurveys availableSurveys]]);
476+
NSArray<IBGSurvey* >* availableSurveys = [IBGSurveys availableSurveys];
477+
NSMutableArray<NSDictionary*>* mappedSurveys = [[NSMutableArray alloc] init];
478+
for (IBGSurvey* survey in availableSurveys) {
479+
[mappedSurveys addObject:@{@"title": survey.title }];
480+
}
481+
callback(@[mappedSurveys]);
477482
}
478483

479484
RCT_EXPORT_METHOD(logUserEventWithName:(NSString *)name) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "instabug-reactnative",
3-
"version": "8.4.0",
3+
"version": "8.4.1",
44
"description": "React Native plugin for integrating the Instabug SDK",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)