From 95a9292d986c91d765665d05ab0b371e78674277 Mon Sep 17 00:00:00 2001 From: Salma Ali Date: Tue, 18 Jun 2019 16:56:50 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=8E=20Bump=20version=20to=208.4.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 fix ios getAvailableSurveys API not returning surveys for ios * 🐛 fix typescript def for the API getAvailableSurveys * 💎 Bump version to 8.4.1 --- CHANGELOG.md | 5 +++++ index.d.ts | 6 +++++- ios/RNInstabug/InstabugReactBridge.m | 7 ++++++- package.json | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc0e731bf..c050d6821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/index.d.ts b/index.d.ts index 412351629..09ec6695e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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; @@ -375,3 +375,7 @@ export enum strings { addFileAttachmentWithUrl(url: string, filename: string); addFileAttachmentWithData(data: string, filename: string); } + +interface Survey { + title: string +} \ No newline at end of file diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index 30a355840..c6878349d 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -473,7 +473,12 @@ - (dispatch_queue_t)methodQueue { } RCT_EXPORT_METHOD(getAvailableSurveys:(RCTResponseSenderBlock)callback) { - callback(@[[IBGSurveys availableSurveys]]); + NSArray* availableSurveys = [IBGSurveys availableSurveys]; + NSMutableArray* mappedSurveys = [[NSMutableArray alloc] init]; + for (IBGSurvey* survey in availableSurveys) { + [mappedSurveys addObject:@{@"title": survey.title }]; + } + callback(@[mappedSurveys]); } RCT_EXPORT_METHOD(logUserEventWithName:(NSString *)name) { diff --git a/package.json b/package.json index 6c1e1db43..69cfe5ea9 100644 --- a/package.json +++ b/package.json @@ -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",