我正在寻找做同样的事情。据我所知,除了从移动 SDK 移植 publishInstall 代码外,没有其他办法。我喜欢 Android SDK 版本。
以下代码来自 Settings.java:
GraphObject publishParams = GraphObject.Factory.create();
publishParams.setProperty("event", "MOBILE_APP_INSTALL");
publishParams.setProperty("attribution", attributionId);
publishParams.setProperty("auto_publish", isAutoPublish);
publishParams.setProperty("application_tracking_enabled", !AppEventsLogger.getLimitEventUsage(context));
publishParams.setProperty("application_package_name", context.getPackageName());
String publishUrl = String.format(PUBLISH_ACTIVITY_PATH, applicationId);
Request publishRequest = Request.newPostRequest(null, publishUrl, publishParams, null);
它看起来像是一个直接的复制请求。我会尽量记住在完成后更新它。