Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 1.4.1
### Fix
- [iOS] Fix `NSRangeException` when logo is not removed on iOS ([Fix #341](https://github.com/note11g/flutter_naver_map/issues/341))
- [Android] Fix access at uninitialized variable NaverMapView.naverMapControlSender ([Fix #340](https://github.com/note11g/flutter_naver_map/issues/340))
- [All Platform] Fix crash when user tapped symbol and using customStyle at the same time ([Fix #339](https://github.com/note11g/flutter_naver_map/issues/339))
- [iOS, XCode Build] Fix Swift Version support issue under 6.1 ([PR #338](https://github.com/note11g/flutter_naver_map/pull/338))

### Update
- [All Platform] **Update Naver Map SDK to 3.22.1**


## 1.4.0

### Breaking Change
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {
}

dependencies {
implementation 'com.naver.maps:map-sdk:3.22.0'
implementation 'com.naver.maps:map-sdk:3.22.1'
implementation 'com.google.android.gms:play-services-location:21.3.0'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,21 @@ internal class SdkInitializer(
}

private fun handle(call: MethodCall, result: MethodChannel.Result) {
if (call.method == "initializeNcp") {
initializeWithNcp(
when (call.method) {
"initializeNcp" -> initializeWithNcp(
call.arguments.asMap(), onSuccess = result::success, onFailure = {
result.error(
if (it is NaverMapSdk.AuthFailedException) it.errorCode else it.javaClass.name,
it.message,
null
)
})
} else if (call.method == "initialize") {
initialize(
"initialize" -> initialize(
call.arguments.asMap(),
onSuccess = result::success,
onFailure = { result.error(it.errorCode, it.message, null) })
"getNativeMapSdkVersion" -> getNativeMapSdkVersion(onSuccess = result::success)
else -> result.notImplemented()
}
}

Expand Down Expand Up @@ -101,4 +102,8 @@ internal class SdkInitializer(
NFlutterException(code = ex.errorCode, message = ex.message).toMessageable()
)
}

private fun getNativeMapSdkVersion(onSuccess: (String) -> Unit) {
onSuccess(com.naver.maps.map.BuildConfig.VERSION_NAME)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal class NaverMapView(
setMapEventListeners()

mapView.onCreate(null)
naverMapControlSender.onMapReady()
if (::naverMap.isInitialized) naverMapControlSender.onMapReady()
deactivateLogo()
}

Expand Down Expand Up @@ -135,7 +135,7 @@ internal class NaverMapView(
onDestroy()
}

naverMapControlSender.dispose()
if (::naverMap.isInitialized) naverMapControlSender.dispose()
}

private fun registerLifecycleCallback() {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ packages:
dependency: transitive
description:
name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev"
source: hosted
version: "2.13.0"
version: "2.12.0"
balloon_widget:
dependency: "direct main"
description:
Expand Down Expand Up @@ -77,10 +77,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
version: "1.3.2"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -143,7 +143,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.4.0"
version: "1.4.1"
flutter_styled_toast:
dependency: "direct main"
description:
Expand Down Expand Up @@ -280,10 +280,10 @@ packages:
dependency: transitive
description:
name: intl
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.20.2"
version: "0.19.0"
lat_compass:
dependency: "direct main"
description:
Expand All @@ -296,10 +296,10 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev"
source: hosted
version: "10.0.9"
version: "10.0.8"
leak_tracker_flutter_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -613,10 +613,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
url: "https://pub.dev"
source: hosted
version: "15.0.0"
version: "14.3.1"
web:
dependency: transitive
description:
Expand All @@ -629,10 +629,10 @@ packages:
dependency: transitive
description:
name: webdriver
sha256: "2f3a14ca026957870cfd9c635b83507e0e51d8091568e90129fbf805aba7cade"
sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
version: "3.0.4"
win32:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion ios/flutter_naver_map.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ flutter naver map plugin
s.source = { :path => '.' }
s.source_files = 'flutter_naver_map/Sources/flutter_naver_map/**/*.swift'
s.dependency 'Flutter'
s.dependency 'NMapsMap','3.22.0'
s.dependency 'NMapsMap','3.22.1'
s.platform = :ios, '12.0'

# Flutter.framework does not contain a i386 slice.
Expand Down
4 changes: 2 additions & 2 deletions ios/flutter_naver_map/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
.library(name: "flutter-naver-map", targets: ["flutter_naver_map"])
],
dependencies: [
.package(url: "https://github.com/navermaps/SPM-NMapsMap.git", from: "3.22.0"),
.package(url: "https://github.com/navermaps/SPM-NMapsMap.git", from: "3.22.1"),
],
targets: [
.target(
Expand All @@ -23,4 +23,4 @@ let package = Package(
resources: [],
)
]
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ internal class NaverMapApplierImpl: NaverMapOptionApplier {
}

func setCustomStyleId(_ rawCustomStyleId: Any?) {
let styleId = castOrNull(rawCustomStyleId, caster: asString) ?? "" /// todo: SDK 업데이트 후 fallback empty string 지우기. 현재는 임시 조치 (정상 동작은 함)
let styleId = castOrNull(rawCustomStyleId, caster: asString)
mapView.setCustomStyleId(
styleId,
loadHandler: customStyleCallbacks?.loadHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@ internal class SdkInitializer: NSObject, NMFAuthManagerDelegate {
}

private func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
if (call.method == "initializeNcp") {
switch call.method {
case "initializeNcp":
initializeWithNcp(asDict(call.arguments!), onSuccess: result)
} else if (call.method == "initialize") {
break
case "initialize":
initialize(asDict(call.arguments!), onSuccess: result)
break
case "getNativeMapSdkVersion":
getNativeMapSdkVersion(onSuccess: result)
break
default:
result(FlutterMethodNotImplemented)
}
}

Expand Down Expand Up @@ -61,6 +69,10 @@ internal class SdkInitializer: NSObject, NMFAuthManagerDelegate {
}

// MARK: End Legacy -----

private func getNativeMapSdkVersion(onSuccess: (Any?) -> Void) {
onSuccess(Bundle.naverMapFrameworkVersion())
}

private func setOnAuthFailedListener() {
NMFAuthManager.shared().delegate = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ internal class NaverMapView: NSObject, FlutterPlatformView {
naverMapControlSender.onMapReady()
deactivateLogo()
}

private func deactivateLogo() {
let subviews = naverMap.mapView.subviews
print("subViews: \(subviews.debugDescription)")
if (subviews.count < 2) { return }
let logoIncludedView = subviews[1]
logoIncludedView.isHidden = true
}
Expand All @@ -44,4 +44,3 @@ internal class NaverMapView: NSObject, FlutterPlatformView {
naverMapControlSender.dispose()
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ internal class NaverMapViewEventDelegate: NSObject, NMFMapViewTouchDelegate, NMF
mapView.setCustomStyleId(
mapView.customStyleId,
loadHandler: sender?.onCustomStyleLoaded,
failHandler: sender?.onCustomStyleLoadFailed,
failHandler: sender?.onCustomStyleLoadFailed
)
}

Expand Down
4 changes: 3 additions & 1 deletion lib/flutter_naver_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import "package:flutter_naver_map/src/initializer/flutter_naver_map_initializer.dart";
import 'package:flutter_naver_map/src/messaging/messaging.dart';
import "package:flutter_naver_map/src/util/custom_data_stream.dart";
import 'package:flutter_naver_map/src/util/image_util.dart';
Expand All @@ -26,6 +27,7 @@ import 'package:flutter_naver_map/src/widget/elements/util/canvas_util.dart';
export 'src/util/location/builtin/default_my_location_tracker.dart';
export 'src/util/location/builtin/default_my_location_tracker_platform_interface.dart'
show NDefaultMyLocationTrackerPermissionStatus;
export 'package:flutter_naver_map/src/initializer/flutter_naver_map_initializer.dart';

/*
--- controller ---
Expand Down Expand Up @@ -55,7 +57,7 @@ part 'src/exceptions/exceptions.dart';
--- initializer ---
*/

part 'src/initializer/flutter_naver_map_initializer.dart';
// part 'src/initializer/flutter_naver_map_initializer.dart';

part 'src/initializer/flutter_naver_map_legacy_initializer.dart';

Expand Down
3 changes: 2 additions & 1 deletion lib/src/exceptions/exceptions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ sealed class NAuthFailedException implements Exception {

NAuthFailedException._(this.code, this.message);

factory NAuthFailedException._fromMessageable(dynamic m) {
@internal
factory NAuthFailedException.fromMessageable(dynamic m) {
final ex = _NRawNativeException.fromMessageable(m);
return NAuthFailedException._internal(ex.code, ex.message);
}
Expand Down
31 changes: 23 additions & 8 deletions lib/src/initializer/flutter_naver_map_initializer.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
part of "../../flutter_naver_map.dart";
import "dart:developer";
import "dart:io";

import "package:flutter/services.dart";
import "package:flutter_naver_map/flutter_naver_map.dart";
import "package:flutter_naver_map/src/messaging/messaging.dart";
import "package:meta/meta.dart";

class FlutterNaverMap {
static bool _isInitialized = false;
@internal
static bool isInitialized = false;

static int? _androidSdkVersion;
@internal
static int? androidSdkVersion;

Function(NAuthFailedException ex)? onAuthFailed;

Expand All @@ -23,7 +31,7 @@ class FlutterNaverMap {
String? clientId,
Function(NAuthFailedException ex)? onAuthFailed,
}) async {
if (!_isInitialized) {
if (!isInitialized) {
NChannel.sdkChannel.setMethodCallHandler(_handler);
}

Expand All @@ -32,16 +40,23 @@ class FlutterNaverMap {
final result = await NChannel.sdkChannel.invokeMethod("initializeNcp",
{"clientId": clientId, "setAuthFailedListener": onAuthFailed != null});

if (result != null) _androidSdkVersion = result["androidSdkVersion"];
_isInitialized = true;
if (result != null) androidSdkVersion = result["androidSdkVersion"];
isInitialized = true;

log("SDK Initialized! (${Platform.operatingSystem}${Platform.isAndroid ? ", SDK $_androidSdkVersion" : ""})",
log("SDK Initialized! (${Platform.operatingSystem}${Platform.isAndroid ? ", SDK $androidSdkVersion" : ""})",
name: "FlutterNaverMap");
}

@internal
Future<String?> getNativeMapSdkVersion() async {
final version = await NChannel.sdkChannel.invokeMethod<String>(
"getNativeMapSdkVersion");
return version;
}

Future<void> _handler(MethodCall call) async {
if (call.method == "onAuthFailed" && onAuthFailed != null) {
onAuthFailed!.call(NAuthFailedException._fromMessageable(call.arguments));
onAuthFailed!.call(NAuthFailedException.fromMessageable(call.arguments));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _NaverMapSdkImpl implements NaverMapSdk {

Future<void> _handler(MethodCall call) async {
if (call.method == "onAuthFailed" && onAuthFailed != null) {
onAuthFailed!.call(NAuthFailedException._fromMessageable(call.arguments));
onAuthFailed!.call(NAuthFailedException.fromMessageable(call.arguments));
}
}
}
Loading
Loading