Skip to content

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

License

Notifications You must be signed in to change notification settings

chicio/Explore-WKScriptMessageHandler

Repository files navigation

Explore WKScriptMessageHandler

Build Status GitHub license Supported platform

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

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 WKWebViews 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.