Skip to content

zentooo/SmallBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interface

for JavaScript

SmallBridge.sendMessage("msg");

SmallBridge.addMessageListener(function(source, data) {
    console.log(source); // bundle ID as String
    console.log(data); // received data as String
});

for iOS

-(void) sendMessage:(NSBundle *) withData:(NSString *)data;

// source is URL of loaded document
-(BOOL) onReceiveMessage:(NSString *)source withData:(NSString *)data;

for Android

public void sendMessage(Context context, String data)

// source is URL of loaded document
public boolean onReceiveMessage(String source, String data)

How to use

on JavaScript

on Android

on iOS

About

Simple bridge (between JavaScript and UIWebView on iOS) and (between JavaScript and WebView on Android)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published