My facebook instant game app which have following url: https://www.facebook.com/instantgames/279246242904501/
When I hit the above game URL, Facebook website load the actual game inside iframe. I just want to pass URL parameter to my game app which I could receive using JavaScript inside my game code.
Can this be possible?
You can use link contexts. This is a currently undocumented feature, but if you navigate to
fb.gg/play/{your_game}/{ref}
you will end up in a unique context based on the value of ref. You can then usecontext.getID()
to determine which context you are in.Note, this can't be used to pass arbitrary date into the game because there's no way to read the string value of ref. There is currently no mechanism by which it is possible to do that.