gree / gree/unity-webview

Can not receive callback in editor?

Open
#268 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C++
Stars
2.7k
Forks
734
Avg merge
11h 39m
Merged PRs (30d)
1

Description

I showed my web page in webview, and on iOS/Android I got a correct callback using javascript.
However, nothing will react if it is Unity Editor.
I want the editor to work as well for development and debugging. What should I do?

//Javascript in web page
$('a').click(function(){
	if (typeof Unity !== "undefined") {
		Unity.call('id=1');  //Android is OK
	} else if (typeof window.webkit !== "undefined") {
		window.webkit.messageHandlers.unityControl.postMessage('id=1');  //iOS is OK
	} else {
		console.log('id=1');  //Web browser is OK
	}
	//Unity Editor is no reaction
});

Unity 5.6.3p4
Mac OS Sierra 10.12.6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided JavaScript callback in the Unity Editor using Unity 5.6.3p4 on macOS, then compare its behavior with the confirmed iOS and Android callbacks. Done means the editor responds to the callback during development and debugging, with the expected behavior documented or reproduced consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, unity
Domain
desktop, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.