An open API service indexing awesome lists of open source software.

https://github.com/chicio/explore-wkscriptmessagehandler

:iphone: An example project created for my blog post "Web to native communication on iOS using WKScriptMessageHandler" :iphone:
https://github.com/chicio/explore-wkscriptmessagehandler

app apple communication ios ipad iphone javascript mobile-app mobile-development native sample-app swift web webki wkscriptmessagehandler wkwebview

Last synced: 6 months ago
JSON representation

:iphone: An example project created for my blog post "Web to native communication on iOS using WKScriptMessageHandler" :iphone:

Awesome Lists containing this project

README

          

# Explore WKScriptMessageHandler

[![Build Status](https://travis-ci.org/chicio/Explore-WKScriptMessageHandler.svg?branch=master)](https://travis-ci.org/chicio/Explore-WKScriptMessageHandler)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/chicio/React-Native-Native-Modules-Communication/master/LICENSE.md)
[![Supported platform](https://img.shields.io/badge/platforms-iOS-orange.svg)](https://img.shields.io/badge/platforms-iOS-orange.svg)

An example project in which I explore how it is possible to use `WKScriptMessageHandler` to make some `WKWebView` web page to native communication.
This is a project for my blog posts [Web to native communication on iOS using WKScriptMessageHandler](https://www.fabrizioduroni.it/2019/08/03/html-javascript-to-native-communication-ios/ "Web to native communication on iOS using WKScriptMessageHandler")

### Description

This is a quote from the post:

> Sooner or later every mobile developer in the world had the following specific need: integrate a website page inside an app. Usually the feature to be developed requires a depp integration between web and native: the app must react to some changes in the web page based on the user interactions or some other events (automatic refresh, geolocation ecc.). The old way to do this integration was to catch some url change/page load using the classical UIWebView delegate methods. But starting from iOS 8 there's a better way to do this integration using `WKWebView`s and `WKScriptMessageHandler`. In this post I will show you how is it possible to use them to call Swift code from Javascript code inside a webpage.

Click on the link above to read the posts.