This translation is community contributed and may not be up to date. We only maintain the English version of the documentation. Read this manual in English
ほとんどのオペレーティングシステムでは、アプリケーションを次のような方法で起動できます。
リンクや通知から、またはインストール時にアプリケーションを起動する場合は、追加の引数を渡せます。たとえば、インストール時のインストールリファラー(install referrer)や、アプリケーション固有のリンクまたは通知から起動する際のディープリンク(deep-link)です。Defold では、ネイティブ拡張(native extension)を使って、アプリケーションがどのように起動されたかという情報を統一された方法で取得できます。
アプリ間通信(Inter-app communication)拡張を使い始めるには、game.project ファイルに依存関係として追加する必要があります。最新の安定版は、次の依存関係 URL で入手できます。
https://github.com/defold/extension-iac/archive/master.zip
特定のリリースの zip ファイルへのリンクを使うことをお勧めします。
API の使い方はとても簡単です。拡張にリスナー関数を登録し、リスナーのコールバックに応じて処理します。
local function iac_listener(self, payload, type)
if type == iac.TYPE_INVOCATION then
-- This was an invocation
print(payload.origin) -- origin may be empty string if it could not be resolved
print(payload.url)
end
end
function init(self)
iac.set_listener(iac_listener)
end
API の完全なドキュメントは、拡張の GitHub ページで参照できます。
Did you spot an error or do you have a suggestion? Please let us know on GitHub!
GITHUB