Skip to content

Commit 5571c3d

Browse files
Map: willRedirectToAppStore() api for android & iOS
1 parent a18e8d2 commit 5571c3d

File tree

17 files changed

+114
-55
lines changed

17 files changed

+114
-55
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip

android/src/main/java/com/instabug/flutter/modules/InstabugApi.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void setCurrentPlatform() {
7676
@Override
7777
public void setEnabled(@NonNull Boolean isEnabled) {
7878
try {
79-
if(isEnabled)
79+
if (isEnabled)
8080
Instabug.enable();
8181
else
8282
Instabug.disable();
@@ -171,13 +171,12 @@ public void setSessionProfilerEnabled(@NonNull Boolean enabled) {
171171

172172
@Override
173173
public void setValueForStringWithKey(@NonNull String value, @NonNull String key) {
174-
if(ArgsRegistry.placeholders.containsKey(key)) {
174+
if (ArgsRegistry.placeholders.containsKey(key)) {
175175
InstabugCustomTextPlaceHolder.Key resolvedKey = ArgsRegistry.placeholders.get(key);
176176
placeHolder.set(resolvedKey, value);
177177
Instabug.setCustomTextPlaceHolders(placeHolder);
178-
}
179-
else {
180-
Log.i(TAG, "Instabug: " + key + " is only relevant to iOS.");
178+
} else {
179+
Log.i(TAG, "Instabug: " + key + " is only relevant to iOS.");
181180
}
182181
}
183182

@@ -397,4 +396,9 @@ public void networkLog(@NonNull Map<String, Object> data) {
397396
Log.e(TAG, "Network logging failed");
398397
}
399398
}
399+
400+
@Override
401+
public void willRedirectToAppStore() {
402+
Instabug.willRedirectToStore();
403+
}
400404
}

android/src/test/java/com/instabug/flutter/InstabugApiTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public void testAddFileAttachmentWithURLWhenFileDoesNotExists() {
493493

494494
@Test
495495
public void testAddFileAttachmentWithData() {
496-
byte[] data = new byte[] {65, 100};
496+
byte[] data = new byte[]{65, 100};
497497
String name = "Issue";
498498

499499
api.addFileAttachmentWithData(data, name);
@@ -549,4 +549,10 @@ public void testNetworkLog() {
549549

550550
mJSONObject.close();
551551
}
552+
553+
@Test
554+
public void testWillRedirectToAppStore() {
555+
api.willRedirectToAppStore();
556+
mInstabug.verify(Instabug::willRedirectToStore);
557+
}
552558
}

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ android {
4444

4545
defaultConfig {
4646
applicationId "com.instabug.flutter.example"
47-
minSdkVersion 18
47+
minSdkVersion flutter.minSdkVersion
4848
targetSdkVersion 30
4949
versionCode flutterVersionCode.toInteger()
5050
versionName flutterVersionName

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ subprojects {
2626
project.evaluationDependsOn(':app')
2727
}
2828

29-
task clean(type: Delete) {
29+
tasks.register("clean", Delete) {
3030
delete rootProject.buildDir
3131
}

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

example/ios/InstabugTests/InstabugApiTests.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,4 +398,11 @@ - (void)testNetworkLog {
398398
]);
399399
}
400400

401+
- (void)testWillRedirectToAppStore {
402+
FlutterError *error;
403+
[self.api willRedirectToAppStoreWithError:&error];
404+
405+
OCMVerify([self.mInstabug willRedirectToAppStore]);
406+
}
407+
401408
@end

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
platform :ios, '11.0'
2+
platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

example/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ EXTERNAL SOURCES:
2323
:path: ".symlinks/plugins/instabug_flutter/ios"
2424

2525
SPEC CHECKSUMS:
26-
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
26+
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
2727
Instabug: 59f0b0bc2c062b5cdbbf417cca365480a1fe55d8
2828
instabug_flutter: f6ea69a1629e5d7dbdd21b1a0d3199a09fe3e43c
2929
OCMock: 5ea90566be239f179ba766fd9fbae5885040b992
3030

31-
PODFILE CHECKSUM: 637e800c0a0982493b68adb612d2dd60c15c8e5c
31+
PODFILE CHECKSUM: 4de1907d67185ba01b9d9c952bfb1b2c3b10d282
3232

33-
COCOAPODS: 1.13.0
33+
COCOAPODS: 1.15.2

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -344,7 +344,7 @@
344344
97C146E61CF9000F007C117D /* Project object */ = {
345345
isa = PBXProject;
346346
attributes = {
347-
LastUpgradeCheck = 1300;
347+
LastUpgradeCheck = 1510;
348348
ORGANIZATIONNAME = "";
349349
TargetAttributes = {
350350
97C146ED1CF9000F007C117D = {
@@ -447,10 +447,12 @@
447447
};
448448
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
449449
isa = PBXShellScriptBuildPhase;
450+
alwaysOutOfDate = 1;
450451
buildActionMask = 2147483647;
451452
files = (
452453
);
453454
inputPaths = (
455+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
454456
);
455457
name = "Thin Binary";
456458
outputPaths = (
@@ -478,6 +480,7 @@
478480
};
479481
9740EEB61CF901F6004384FC /* Run Script */ = {
480482
isa = PBXShellScriptBuildPhase;
483+
alwaysOutOfDate = 1;
481484
buildActionMask = 2147483647;
482485
files = (
483486
);
@@ -674,7 +677,7 @@
674677
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
675678
GCC_WARN_UNUSED_FUNCTION = YES;
676679
GCC_WARN_UNUSED_VARIABLE = YES;
677-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
680+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
678681
MTL_ENABLE_DEBUG_INFO = NO;
679682
SDKROOT = iphoneos;
680683
SUPPORTED_PLATFORMS = iphoneos;
@@ -760,7 +763,7 @@
760763
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
761764
GCC_WARN_UNUSED_FUNCTION = YES;
762765
GCC_WARN_UNUSED_VARIABLE = YES;
763-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
766+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
764767
MTL_ENABLE_DEBUG_INFO = YES;
765768
ONLY_ACTIVE_ARCH = YES;
766769
SDKROOT = iphoneos;
@@ -809,7 +812,7 @@
809812
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
810813
GCC_WARN_UNUSED_FUNCTION = YES;
811814
GCC_WARN_UNUSED_VARIABLE = YES;
812-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
815+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
813816
MTL_ENABLE_DEBUG_INFO = NO;
814817
SDKROOT = iphoneos;
815818
SUPPORTED_PLATFORMS = iphoneos;

0 commit comments

Comments
 (0)