kangsudal / whats_for_dinner

1 stars 1 forks source link

UNKNOWN_URL_SCHEME #19

Closed kangsudal closed 1 year ago

kangsudal commented 1 year ago

WebView로 띄운 화면에서 전화하기와 길찾기를 누르면 다음과같이 에러가 뜬다(웹으로 보여주거나 다른 앱을 띄워줄줄 알았다.)

flutter webview intent로 검색해보니 https://velog.io/@mlmlmlmlz/Flutter-%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C-WebView-%EC%9D%B4%EB%8B%88%EC%8B%9C%EC%8A%A4-intent-%EC%98%A4%EB%A5%98-%ED%95%B4%EA%B2%B0 methodChannel에대해 공부해봐야겠다

kangsudal commented 1 year ago

https://papabee.tistory.com/284

https://dev-in-gym.tistory.com/40

https://flutter-ko.dev/docs/development/platform-integration/platform-channels#%ED%94%8C%EB%9E%AB%ED%8F%BC-%EB%B3%84-%EC%BD%94%EB%93%9C%EB%A5%BC-ui-%EC%BD%94%EB%93%9C%EC%97%90%EC%84%9C-%EB%B6%84%EB%A6%AC%ED%95%98%EA%B8%B0

https://velog.io/@mlmlmlmlz/Flutter-%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C-WebView-%EC%9D%B4%EB%8B%88%EC%8B%9C%EC%8A%A4-intent-%EC%98%A4%EB%A5%98-%ED%95%B4%EA%B2%B0

kangsudal commented 1 year ago

키워드(패턴?)는 MethodChannel('메소드채널이름') .invokeMethod('OS메소드/ browseNaver')

MethodChannel(flutterView, '메소드채널이름').setMethodCallHandler{ methodCall, result ->
   methodCall.method == 'OS메소드/browseNaver'
} 

나는 kotlin위주의 코드를 찾고있다.

kangsudal commented 1 year ago

https://stackoverflow.com/questions/56421218/how-to-allow-mailto-and-tel-url-schemes-in-webview-flutter

구글맵으로 지도 찾기가 되서 웹뷰를 통해 네이버 지도는 말고 전화걸기만 되게만드려고함

https://github.com/flutter/flutter/issues/29910

kangsudal commented 1 year ago

https://dev-yakuza.posstree.com/ko/flutter/url_launcher/external_link/

void openWebView(Restaurant restaurant)async{

  final url = Uri.parse('https://search.naver.com/search.naver?where=nexearch&query=${restaurant.address} ${restaurant.name}');
  if (await canLaunchUrl(url)) {
    launchUrl(url, mode: LaunchMode.externalApplication);//외부 브라우저로 열기
  }
}

외부 브라우저로 여는방법 채택