Skip to content

Commit

Permalink
💎 Bump version to 8.4.1
Browse files Browse the repository at this point in the history
* 🐛 fix ios getAvailableSurveys API not returning surveys for ios

* 🐛 fix typescript def for the API getAvailableSurveys

* 💎 Bump version to 8.4.1
  • Loading branch information
salmamali authored Jun 18, 2019
1 parent 369cabc commit 95a9292
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v8.4.1 (2019-06-17)

* Fixes Surveys.getAvailableSurveys API not returning the list of surveys on iOS.
* Fixes typescript definition for the API Surveys.getAvailableSurveys.

## v8.4.0 (2019-06-11)

* Updates native iOS and Android SDKs to version 8.4.
Expand Down
6 changes: 5 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export namespace Surveys {
sessionCount: number,
daysCount: number
): void;
function getAvailableSurveys(availableSurveysCallback: () => void): void;
function getAvailableSurveys(availableSurveysCallback: (surveys: Survey[]) => void): void;
function setAutoShowingEnabled(autoShowingSurveysEnabled: boolean): void;
function onShowCallback(willShowSurveyHandler: () => void): void;
function setOnShowHandler(onShowHandler: () => void): void;
Expand Down Expand Up @@ -375,3 +375,7 @@ export enum strings {
addFileAttachmentWithUrl(url: string, filename: string);
addFileAttachmentWithData(data: string, filename: string);
}

interface Survey {
title: string
}
7 changes: 6 additions & 1 deletion ios/RNInstabug/InstabugReactBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,12 @@ - (dispatch_queue_t)methodQueue {
}

RCT_EXPORT_METHOD(getAvailableSurveys:(RCTResponseSenderBlock)callback) {
callback(@[[IBGSurveys availableSurveys]]);
NSArray<IBGSurvey* >* availableSurveys = [IBGSurveys availableSurveys];
NSMutableArray<NSDictionary*>* mappedSurveys = [[NSMutableArray alloc] init];
for (IBGSurvey* survey in availableSurveys) {
[mappedSurveys addObject:@{@"title": survey.title }];
}
callback(@[mappedSurveys]);
}

RCT_EXPORT_METHOD(logUserEventWithName:(NSString *)name) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "instabug-reactnative",
"version": "8.4.0",
"version": "8.4.1",
"description": "React Native plugin for integrating the Instabug SDK",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 95a9292

Please sign in to comment.