From my Android app, I would like to publish its installation back to facebook to track conversions for my new mobile app install ads, but I would like to do this without using their api.
So, instead of doing
com.facebook.Settings.publishInstall(context, appId);
I would just send an HTTP request with the required parameters to some URL.
EDIT:
I registered two requests that are sent to facebook to publish the installation of the application, and they look like this:
Request:
GET /[app id]?format=json&sdk=android&fields=supports_attribution HTTP/1.1 User-Agent: FBAndroidSDK.3.0.0.b Content-Type: multipart/form-data; boundary=3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f Host: graph.facebook.com Connection: Keep-Alive Accept-Encoding: gzip
Answer:
HTTP/1.1 200 OK Access-Control-Allow-Origin: * Cache-Control: private, no-cache, no-store, must-revalidate Content-Type: text/javascript; charset=UTF-8 ETag: "24ea6554744eece05b90dd2e65af63277cdcaf53" Expires: Sat, 01 Jan 2000 00:00:00 GMT Pragma: no-cache X-FB-Rev: 658994 X-FB-Debug: P2GE3fDVAnRJh62rBS5WXD4ce1hTy8Pwvjq5rT/I+TI= Date: Tue, 30 Oct 2012 11:37:09 GMT Connection: keep-alive Content-Length: 52 {"supports_attribution":true,"id":"[app id]"}
Request:
POST /[app id]/activities?format=json&sdk=android&migration_bundle=fbsdk%3A20120913 HTTP/1.1 User-Agent: FBAndroidSDK.3.0.0.b Content-Type: multipart/form-data; boundary=3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f Host: graph.facebook.com Connection: Keep-Alive Transfer-Encoding: chunked Accept-Encoding: gzip 261 --3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f Content-Disposition: form-data; name="format" json --3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f Content-Disposition: form-data; name="sdk" android --3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f Content-Disposition: form-data; name="migration_bundle" fbsdk:20120913 --3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f Content-Disposition: form-data; name="attribution" ab175007-2725-464f-a111-b8b1a92bf1dd --3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f Content-Disposition: form-data; name="event" MOBILE_APP_INSTALL --3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f 0
Answer:
HTTP/1.1 200 OK Access-Control-Allow-Origin: * Cache-Control: private, no-cache, no-store, must-revalidate Content-Type: text/javascript; charset=UTF-8 Expires: Sat, 01 Jan 2000 00:00:00 GMT Pragma: no-cache X-FB-Rev: 658994 X-FB-Debug: +0GWQ4cu+tFeAg3QEuwYGx+HAt7t37itzxEYBaTZF8U= Date: Tue, 30 Oct 2012 11:38:33 GMT Connection: keep-alive Content-Length: 4 true
I have included a cropped version of facebook api in my application that cannot do anything, but just send these two requests. I will try and talk about how it works.
Optimally, I would like to send requests from the server, and not from the phone at all.