Skip to content

Commit 617145f

Browse files
committed
update iOS SDK 1.3.1.1
1 parent a07f431 commit 617145f

10 files changed

+33
-28
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## V1.1.0
22

33
Support null safety
4+
Use TPNS iOS SDK 1.3.1.1
45

56
## V1.0.7
67

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- TPNS-iOS (1.2.9.0)
3+
- TPNS-iOS (1.3.1.1)
44
- tpns_flutter_plugin (1.0.4):
55
- Flutter
6-
- TPNS-iOS (~> 1.2.9.0)
6+
- TPNS-iOS (~> 1.3.1.1)
77

88
DEPENDENCIES:
99
- Flutter (from `Flutter`)

example/lib/ios/flutter_tableview.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ class _FlutterTableViewState extends State<FlutterTableView> {
107107
////////////////////////////////////////////////////////////////////
108108
SectionHeaderModel currentHeaderModel;
109109
int totalItemCount = 0;
110-
List<SectionHeaderModel> sectionHeaderList = List();
111-
List<int> sectionTotalWidgetCountList = List();
110+
List<SectionHeaderModel> sectionHeaderList = [];
111+
List<int> sectionTotalWidgetCountList = [];
112112
ScrollController scrollController;
113113
ListView listView;
114114
bool insideSetStateFlag = false;
@@ -292,7 +292,6 @@ class _FlutterTableViewState extends State<FlutterTableView> {
292292
293293
@override
294294
void dispose() {
295-
// TODO: implement dispose
296295
super.dispose();
297296

298297
if (this.widget.controller == null) {

example/lib/ios/homeTest.dart

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class HomeTestBody extends StatefulWidget {
2828
}
2929

3030
class HomeTestBodyState extends State<HomeTestBody> {
31+
final XgFlutterPlugin tpush = new XgFlutterPlugin();
3132
String inputStr = "flutter";
3233

3334
// Get row count.
@@ -95,31 +96,31 @@ class HomeTestBodyState extends State<HomeTestBody> {
9596
void _doAction(int section, int row) {
9697
if (section == 0) {
9798
if (row == 0) {
98-
XgFlutterPlugin().setAccount(inputStr, AccountType.UNKNOWN);
99+
tpush.setAccount(inputStr, AccountType.UNKNOWN);
99100
} else if (row == 1) {
100-
XgFlutterPlugin().deleteAccount(inputStr, AccountType.UNKNOWN);
101+
tpush.deleteAccount(inputStr, AccountType.UNKNOWN);
101102
} else if (row == 2) {
102-
XgFlutterPlugin().cleanAccounts();
103+
tpush.cleanAccounts();
103104
}
104105
} else if (section == 1) {
105106
if (row == 0) {
106-
XgFlutterPlugin().addTags([inputStr]);
107+
tpush.addTags([inputStr]);
107108
} else if (row == 1) {
108-
XgFlutterPlugin().deleteTags([inputStr]);
109+
tpush.deleteTags([inputStr]);
109110
} else if (row == 2) {
110-
XgFlutterPlugin().setTags([inputStr]);
111+
tpush.setTags([inputStr]);
111112
} else if (row == 3) {
112-
XgFlutterPlugin().cleanTags();
113+
tpush.cleanTags();
113114
}
114115
} else if (section == 2) {
115116
if (row == 0) {
116-
XgFlutterPlugin().startXg("1600007893", "IX4BGYYG8L4L");
117+
tpush.startXg("1600007893", "IX4BGYYG8L4L");
117118
} else if (row == 1) {
118-
XgFlutterPlugin().stopXg();
119+
tpush.stopXg();
119120
} else if (row == 2) {
120121
getXgToken();
121122
} else if (row == 3) {
122-
XgFlutterPlugin().setBadge(int.parse(inputStr));
123+
tpush.setBadge(int.parse(inputStr));
123124
} else if (row == 4) {
124125
getXgSdkVersion();
125126
}

example/tpns_flutter_plugin.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A new flutter plugin project.
1515
s.source = { :git => "https://github.com/TencentCloud/TPNS-Flutter-Plugin", :branch => "V1.1.0" }
1616
s.source_files = 'Classes/**/*'
1717
s.dependency 'Flutter'
18-
s.dependency 'TPNS-iOS', '1.2.9.0'
18+
s.dependency 'TPNS-iOS', '1.3.1.1'
1919
s.platform = :ios, '8.0'
2020
s.static_framework = true
2121
end

ios/Classes/XgFlutterPlugin.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ - (id)init {
3333
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
3434
if ([@"xgSdkVersion" isEqualToString:call.method]) {
3535
result([[XGPush defaultManager] sdkVersion]);
36+
} else if([@"getOtherPushToken" isEqualToString:call.method]) {
37+
result([[XGPushTokenManager defaultTokenManager] deviceTokenString]);
3638
} else if([@"xgToken" isEqualToString:call.method]) {
3739
result([[XGPushTokenManager defaultTokenManager] xgTokenString]);
3840
} else if([@"startXg" isEqualToString:call.method]) {
@@ -174,6 +176,8 @@ - (void)deleteTags:(FlutterMethodCall*)call result:(FlutterResult)result {
174176

175177
/**===================================V1.0.4废弃账号标签接口===================================*/
176178

179+
#pragma clang diagnostic push
180+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
177181
/// 绑定标签或账号
178182
- (void)bindWithIdentifier:(FlutterMethodCall*)call result:(FlutterResult)result {
179183
NSDictionary *configurationInfo = call.arguments;
@@ -220,6 +224,8 @@ - (void)clearAllIdentifier:(FlutterMethodCall*)call result:(FlutterResult)result
220224
[[XGPushTokenManager defaultTokenManager] clearAllIdentifiers:[configurationInfo[@"bindType"] integerValue]];
221225
}
222226

227+
#pragma clang diagnostic pop
228+
223229
/**==========================================================================*/
224230

225231

@@ -358,6 +364,8 @@ - (void)xgPushDidClearTagsError:(NSError *)error {
358364

359365
/**=======================================================================*/
360366

367+
#pragma clang diagnostic push
368+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
361369
- (void)xgPushDidBindWithIdentifier:(NSString *)identifier type:(XGPushTokenBindType)type error:(NSError *)error {
362370
NSString *argumentDescribe = type == XGPushTokenBindTypeAccount ? @"绑定账号" : @"绑定标签";
363371
NSString *resultStr = error == nil ? @"成功" : [NSString stringWithFormat:@"失败,error:%@", error.description];
@@ -393,6 +401,7 @@ - (void)xgPushDidClearAllIdentifiers:(XGPushTokenBindType)type error:(NSError *)
393401
NSString *resultStr = error == nil ? @"成功" : [NSString stringWithFormat:@"失败,error:%@", error.description];
394402
[_channel invokeMethod:@"xgPushDidClearAllIdentifiers" arguments:[NSString stringWithFormat:@"%@%@", argumentDescribe, resultStr]];
395403
}
404+
#pragma clang diagnostic pop
396405

397406
#pragma mark - AppDelegate
398407

ios/tpns_flutter_plugin.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A new flutter plugin project.
1515
s.source = { :git => "https://github.com/TencentCloud/TPNS-Flutter-Plugin", :branch => "V1.1.0" }
1616
s.source_files = 'Classes/**/*'
1717
s.dependency 'Flutter'
18-
s.dependency 'TPNS-iOS', '1.2.9.0'
18+
s.dependency 'TPNS-iOS', '1.3.1.1'
1919
s.platform = :ios, '8.0'
2020
s.static_framework = true
2121
end

lib/android/xg_android_api.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:flutter/services.dart';
55
import 'native_event_handler.dart';
66

77
class XgAndroidApi {
8-
final String flutter_log = "| XGPUSH | Flutter | ";
8+
final String flutterLog = "| XGPUSH | Flutter | ";
99
static MethodChannel? _channel;
1010
NativeEventHandler? _eventHandler;
1111

lib/tpns_flutter_plugin.dart

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,10 @@ class XgFlutterPlugin {
9999
return xgToken;
100100
}
101101

102-
/// 获取安卓厂商 token,当前仅对安卓有效
102+
/// 获取厂商Token,区别于tpns token
103103
static Future<String?> get otherPushToken async {
104-
if (Platform.isIOS) {
105-
106-
} else {
107-
final String otherPushToken = await _channel.invokeMethod(
108-
'getOtherPushToken');
109-
return otherPushToken;
110-
}
104+
final String otherPushToken = await _channel.invokeMethod('getOtherPushToken');
105+
return otherPushToken;
111106
}
112107

113108
/// 获取安卓厂商品牌,当前仅对安卓有效
@@ -380,7 +375,7 @@ class XgFlutterPlugin {
380375
}
381376
}
382377

383-
/*******************************************请不要再使用以上账号和标签接口****************************************************/
378+
//*******************************************请不要再使用以上账号和标签接口****************************************************/
384379

385380
/* ======信鸽callback====== */
386381

test/tpns_flutter_plugin_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:flutter/services.dart';
22
import 'package:flutter_test/flutter_test.dart';
3-
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
3+
// import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
44

55
void main() {
66
const MethodChannel channel = MethodChannel('tpns_flutter_plugin');

0 commit comments

Comments
 (0)