UPDATED:
Ignore my previous answer, I misinterpreted the type of dialog that you were trying to produce.
As mentioned in the comments, your code doesn't seem to be the problem since you are successfully getting a notification. Simply follow the steps in the Facebook app creation doc to make sure you are setting your app up correctly, specifying a Canvas URL as shown in the first image to make sure your app can provide invitations properly.
The examples on the same page should provide more help with using the URLs also.