Skip to content

Commit c210e1b

Browse files
holailusorianhils1411
authored andcommitted
release 7.3.6
1 parent 9235ac3 commit c210e1b

File tree

19 files changed

+234
-57
lines changed

19 files changed

+234
-57
lines changed

CHANGELOG.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
1+
# 7.3.6
2+
3+
* Fixed a bug with receiving push notifications when the application is closed in Android.
4+
5+
# 7.3.5
6+
7+
* Fixed bug thats stayLoggedIn is true but method getUserToken returns null after restart application.
8+
9+
# 7.3.4
10+
11+
* Fixed uncorrect type casting in BackendlessException class.
12+
13+
# 7.3.3
14+
15+
* Fixed error thats appear when trying to get currentUser thats equals null(web).
16+
17+
# 7.3.2
18+
19+
* Fixed bug when getCurrentUser in web returned error.
20+
21+
# 7.3.1
22+
23+
* Added parameter 'attachments' to sendEmailFromTemplate method.
24+
125
# 7.3.0
226

3-
* Bump Backendless Android SDK version to 7.0.0
27+
* Bump Backendless Android SDK version to 7.0.0.
428

529
# 7.2.12
630

731
* Fixed a bug with an issue where the user token would continue to be sent in a custom service request even after logout.
8-
32+
s
933
# 7.2.11
1034

1135
* Fixed bug in web with nested relations named the same as global js classes.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Follow the steps below to get started with Backendless Flutter SDK:
1919
To use this plugin in your Flutter project, add `backendless_sdk` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/):
2020
```dart
2121
dependencies:
22-
backendless_sdk: ^7.3.0
22+
backendless_sdk: ^7.3.6
2323
```
2424
#### STEP 2. Import the Backendless SDK:
2525
Add the following import to your Dart code

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ dependencies {
3838
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
3939
api 'com.google.firebase:firebase-messaging:20.0.0'
4040

41-
api 'com.backendless:android-client-sdk:7.0.0-RC3'
41+
api 'com.backendless:android-client-sdk:7.0.3'
4242
}

android/src/main/java/com/backendless/backendless_sdk/call_handlers/MessagingCallHandler.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,26 @@ private void sendEmailFromTemplate(MethodCall call, MethodChannel.Result result)
250250
String templateName = call.argument("templateName");
251251
EmailEnvelope envelope = call.argument("envelope");
252252
Map<String, String> templateValues = call.argument("templateValues");
253+
List<String> attachments = call.argument("attachments");
253254

254255
FlutterCallback<MessageStatus> callback = new FlutterCallback<>(result);
255256

256-
if (templateValues != null) {
257+
if (attachments == null) {
258+
if (templateValues == null) {
259+
Backendless.Messaging.sendEmailFromTemplate(templateName, envelope, callback);
260+
return;
261+
}
262+
257263
Backendless.Messaging.sendEmailFromTemplate(templateName, envelope, templateValues, callback);
258-
} else {
259-
Backendless.Messaging.sendEmailFromTemplate(templateName, envelope, callback);
264+
return;
265+
}
266+
267+
if (templateValues == null) {
268+
Backendless.Messaging.sendEmailFromTemplate(templateName, envelope, attachments, callback);
269+
return;
260270
}
271+
272+
Backendless.Messaging.sendEmailFromTemplate(templateName,envelope, templateValues, attachments, callback);
261273
}
262274

263275
private void subscribe(MethodCall call, MethodChannel.Result result) {

android/src/main/java/com/backendless/backendless_sdk/utils/codec/BackendlessMessageCodec.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import com.backendless.backendless_sdk.utils.codec.mixins.ReconnectAttemptMixin;
1111
import com.backendless.commerce.GooglePlayPurchaseStatus;
1212
import com.backendless.commerce.GooglePlaySubscriptionStatus;
13+
import com.backendless.exceptions.BackendlessException;
14+
import com.backendless.exceptions.BackendlessFault;
1315
import com.backendless.files.FileInfo;
1416
import com.backendless.messaging.DeliveryOptions;
1517
import com.backendless.messaging.EmailEnvelope;
@@ -80,6 +82,8 @@ public final class BackendlessMessageCodec extends StandardMessageCodec {
8082
private static final byte LINE_STRING = (byte) 156;
8183
private static final byte POLYGON = (byte) 157;
8284
private static final byte RELATION_STATUS = (byte) 158;
85+
private static final byte BACKENDLESS_FAULT = (byte) 159;
86+
private static final byte BACKENDLESS_EXCEPTION = (byte) 160;
8387

8488
private BackendlessMessageCodec() {
8589
objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_INDEX);
@@ -193,7 +197,14 @@ protected void writeValue(ByteArrayOutputStream stream, Object value) {
193197
Object[] array = (Object[]) value;
194198
List list = Arrays.asList(array);
195199
writeValue(stream, list);
196-
} else {
200+
} else if (value instanceof BackendlessFault){
201+
stream.write(BACKENDLESS_FAULT);
202+
writeValue(stream, objectMapper.convertValue(value, Map.class));
203+
} else if( value instanceof BackendlessException) {
204+
stream.write(BACKENDLESS_EXCEPTION);
205+
writeValue(stream, objectMapper.convertValue(value, Map.class));
206+
}
207+
else {
197208
super.writeValue(stream, value);
198209
}
199210
}
@@ -255,6 +266,10 @@ protected Object readValueOfType(byte type, ByteBuffer buffer) {
255266
return Polygon.<Polygon>fromWKT((String) readValue(buffer));
256267
case RELATION_STATUS:
257268
return objectMapper.convertValue(readValue(buffer), RelationStatus.class);
269+
case BACKENDLESS_FAULT:
270+
return objectMapper.convertValue(readValue(buffer), BackendlessFault.class);
271+
case BACKENDLESS_EXCEPTION:
272+
return objectMapper.convertValue(readValue(buffer), BackendlessException.class);
258273
default:
259274
return super.readValueOfType(type, buffer);
260275
}

example/android/app/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ android {
4848
release {
4949
// TODO: Add your own signing config for the release build.
5050
// Signing with the debug keys for now, so `flutter run --release` works.
51+
minifyEnabled true
52+
53+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
54+
signingConfig signingConfigs.debug
55+
}
56+
debug {
5157
signingConfig signingConfigs.debug
5258
}
5359
}
@@ -58,6 +64,7 @@ flutter {
5864
}
5965

6066
dependencies {
67+
implementation 'com.android.support:multidex:1.0.3'
6168
testImplementation 'junit:junit:4.13.1'
6269
androidTestImplementation 'com.android.support.test:runner:1.0.2'
6370
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
-keep class io.flutter.app.** { *; }
2+
-keep class io.flutter.plugin.** { *; }
3+
-keep class io.flutter.util.** { *; }
4+
-keep class io.flutter.view.** { *; }
5+
-keep class io.flutter.** { *; }
6+
-keep class io.flutter.plugins.** { *; }
7+
-dontwarn com.backendless.**
8+
-dontwarn weborb.**
9+
-keep class com.google.android.gms.** { *; }
10+
-keep class com.google.firebase.** { *; }
11+
-keep class weborb.** {*;}
12+
-keep class com.backendless.** {*;}
13+
-keepattributes *JavascriptInterface*
14+
15+
## Gson rules
16+
# Gson uses generic type information stored in a class file when working with fields. Proguard
17+
# removes such information by default, so configure it to keep all of it.
18+
-keepattributes Signature
19+
20+
# For using GSON @Expose annotation
21+
-keepattributes *Annotation*
22+
23+
# Gson specific classes
24+
-dontwarn sun.misc.**
25+
#-keep class com.google.gson.stream.** { *; }
26+
27+
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
28+
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
29+
-keep class * extends com.google.gson.TypeAdapter
30+
-keep class * implements com.google.gson.TypeAdapterFactory
31+
-keep class * implements com.google.gson.JsonSerializer
32+
-keep class * implements com.google.gson.JsonDeserializer
33+
34+
# Prevent R8 from leaving Data object members always null
35+
-keepclassmembers,allowobfuscation class * {
36+
@com.google.gson.annotations.SerializedName <fields>;
37+
}
38+
39+
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
40+
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
41+
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken

example/android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
package="com.backendless.backendless_sdk_example">
33
<application
44
android:label="backendless_sdk_example"
5-
android:icon="@mipmap/ic_launcher">
5+
android:icon="@mipmap/ic_launcher"
6+
android:usesCleartextTraffic="true">
67
<activity
78
android:name="io.flutter.embedding.android.FlutterActivity"
89
android:launchMode="singleTop"
@@ -29,4 +30,5 @@
2930

3031
<uses-permission android:name="android.permission.INTERNET" />
3132
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
33+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
3234
</manifest>

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30-
<Testables>
31-
</Testables>
3230
<MacroExpansion>
3331
<BuildableReference
3432
BuildableIdentifier = "primary"
@@ -38,11 +36,11 @@
3836
ReferencedContainer = "container:Runner.xcodeproj">
3937
</BuildableReference>
4038
</MacroExpansion>
41-
<AdditionalOptions>
42-
</AdditionalOptions>
39+
<Testables>
40+
</Testables>
4341
</TestAction>
4442
<LaunchAction
45-
buildConfiguration = "Debug"
43+
buildConfiguration = "Release"
4644
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4745
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
4846
launchStyle = "0"
@@ -61,8 +59,6 @@
6159
ReferencedContainer = "container:Runner.xcodeproj">
6260
</BuildableReference>
6361
</BuildableProductRunnable>
64-
<AdditionalOptions>
65-
</AdditionalOptions>
6662
</LaunchAction>
6763
<ProfileAction
6864
buildConfiguration = "Profile"

example/lib/main.dart

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@ import 'package:backendless_sdk/backendless_sdk.dart';
22
import 'package:flutter/material.dart';
33

44
void main() {
5+
const String APP_ID = 'APP_ID';
6+
const String ANDROID_KEY = 'ANDROID_API_KEY';
7+
const String IOS_KEY = 'IOS_API_KEY';
8+
const String JS_KEY = 'JS_KEY';
9+
510
WidgetsFlutterBinding.ensureInitialized();
611

7-
runApp(MyApp());
12+
Backendless.initApp(
13+
applicationId: APP_ID,
14+
androidApiKey: ANDROID_KEY,
15+
iosApiKey: IOS_KEY,
16+
jsApiKey: JS_KEY);
17+
18+
runApp(MaterialApp(home: MyApp()));
819
}
920

1021
class MyApp extends StatefulWidget {
@@ -13,23 +24,14 @@ class MyApp extends StatefulWidget {
1324
}
1425

1526
class _MyAppState extends State<MyApp> {
16-
static const String APP_ID = 'APP_ID';
17-
static const String ANDROID_KEY = 'ANDROID_API_KEY';
18-
static const String IOS_KEY = 'IOS_API_KEY';
19-
static const String JS_KEY = 'JS_API_KEY';
20-
2127
@override
2228
void initState() {
2329
super.initState();
24-
Backendless.initApp(
25-
applicationId: APP_ID,
26-
androidApiKey: ANDROID_KEY,
27-
iosApiKey: IOS_KEY,
28-
jsApiKey: JS_KEY);
2930
}
3031

3132
void buttonPressed() async {
3233
// create a Map object. This will become a record in a database table
34+
3335
Map testObject = new Map();
3436

3537
// add a property to the object.
@@ -42,8 +44,8 @@ class _MyAppState extends State<MyApp> {
4244
Backendless.data.of("TestTable").save(testObject).then((response) =>
4345
print("Object is saved in Backendless. Please check in the console."));
4446

45-
var data = await Backendless.data.of('TestTable').find();
46-
print(data);
47+
var res = await Backendless.data.of("TestTable").find();
48+
print(res);
4749
}
4850

4951
@override
@@ -58,7 +60,10 @@ class _MyAppState extends State<MyApp> {
5860
crossAxisAlignment: CrossAxisAlignment.center,
5961
mainAxisAlignment: MainAxisAlignment.center,
6062
children: <Widget>[
61-
ElevatedButton(child: Text("Press"), onPressed: buttonPressed)
63+
ElevatedButton(
64+
child: Text("Press"),
65+
onPressed: buttonPressed,
66+
),
6267
],
6368
)),
6469
),

0 commit comments

Comments
 (0)