FacebookPSModule may require updates

Coordinator
Apr 28, 2015 at 5:07 PM
I just saw a notice on Twitter of changes to FacebookPSModule which may be required. I would like some confirmation that someone out there is using this. Please reply to this thread.

https://developers.facebook.com/docs/apps/review#submitlogin
https://developers.facebook.com/apps/upgrade/?ref=devsite_banner
May 4, 2015 at 11:47 PM
I was testing the FacebookPSModule, and I have two say that it is great!! but last week it stopped working , is this related to this?
Coordinator
May 4, 2015 at 11:56 PM
I would like to understand that myself. Could you recreate your Facebook connection and retry? Also copy the exact error message into the thread. Thanks, Jon
May 5, 2015 at 5:39 AM
Thanks so much for the quick response.
Checking the Graph Api facebook page says:
The current, latest version of the Graph API is v2.3. Apps calling v1.0 have until April 30, 2015 to upgrade to v2.0 or later.

Could be this related to this?.

I tried in two different computers, windows 7 and windows 8, a lot of the cmdlets do not return anything , Get-FBFriend returns this:

S C:\Windows\System32\WindowsPowerShell\v1.0> Get-FBFriend
Convert-FBJSON : Error in Convert_FBJSON: You cannot call a method on a null-valued expression.
At C:\Users\abarcar\Documents\WindowsPowerShell\Modules\Facebook\Facebook.ps1:1675 char:9
  • Convert-FBJSON $raw | MarkWithType $TypeName
  • ~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Convert-FBJSON
Get-FBAssociation : Error in Get-FBAssociation: You cannot call a method on a null-valued expression.
At C:\Users\abarcar\Documents\WindowsPowerShell\Modules\Facebook\Facebook.ps1:1734 char:19
  • $retval = Get-FBAssociation -Id $Id -Fields $Fields -Type "Friends" -Typ ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-FBAssociation
Get-FBFriend : Error in Get-FBFriend: You cannot call a method on a null-valued expression.
At line:1 char:1
  • Get-FBFriend
  • ~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-FBFriend
Convert-FBJSON : You cannot call a method on a null-valued expression.
At C:\Users\abarcar\Documents\WindowsPowerShell\Modules\Facebook\Facebook.ps1:1675 char:9
  • Convert-FBJSON $raw | MarkWithType $TypeName
  • ~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [Convert-FBJSON], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull,Convert-FBJSON
Regards
Coordinator
May 11, 2015 at 7:44 PM
I would like to hear from other users so that I know whether to prioritize this.

I retried FacebookPSModule last night and I am seeing some oddities. It looks like the "Owner" app associated with FacebookPSModule has been automatically updated to v2.0. Get-FBFriend is showing some paging oddities (I get back paging even when there are only 2 datapoints for my test account) and New-FBConnection is also having issues. I may have to request app approval and also make some code changes.
Coordinator
May 15, 2015 at 3:16 AM
Reabarca, please try this code change in Facebook.ps1 and let me know whether it fixes your issue. This works for me. If you confirm I can work on uploading a new version of the module. Thanks, Jon

[string[]]$FB_DefaultExtendedPermissions = @(
        "user_about_me",
        #"friends_about_me",
        "user_events",
        #"friends_events",
        "user_groups",
        #"friends_groups",
        "user_interests",
        #"friends_interests",
        "user_relationships",
        #"friends_relationships",
        "user_religion_politics",
        #"friends_religion_politics",
        "read_friendlists",
        #"manage_friendlists",
        "manage_pages",
        "email",
        #"publish_stream",
        #"offline_access",
        #"create_event",
        #"create_note",
        #"photo_upload",
        #"publish_stream",
        "read_stream",
        #"rsvp_update",
        #"share_item",
        #"status_update",
        "user_photos",
        "user_birthday",
        "user_education_history",
        "user_likes"
        #"user_checkins"
        )
May 18, 2015 at 1:00 PM
John_msft,

Thanks for your module. It has been very helpful to me. I experienced the same issues that reabarca78 did with the module stopping on 4/30. I tried the edit to facebook.ps1 you showed above, but I'm still not getting any data back.
May 18, 2015 at 9:17 PM
Hi John,

I modified the Facebook.ps1 to use my own App ID and Secret, I changed the $FB_DefaultExtendedPermissions array as requested, now get-fbevent cmdlet is working, get-FbFriend only returns my userId, I read somewhere that the new version of Graph Api only allows to get this information from users who installed the app, so I can not get the list of events my friends are attending, so I am now gathering this info from the Groups feeds.

Thanks so much for your help John, and great PS module.

Regards
Aug 10, 2015 at 4:35 AM
Hi John,

It seems this is from a change to the Graph API as per v2 - see the Graph API Changelog here https://developers.facebook.com/docs/apps/changelog/#v2_0

I've submitted a bug to facebook as this should be allowable for non-Public published apps (i.e ones for your own use) as for my use case is that I want to be able to group friends into friendlists based on Geographical location - so EU, US, Asia etc

If I hear back from them i'll update this thread
Dec 16, 2015 at 1:44 AM
Yeah. No worky worky for me either. Like someone else said Get-FBObjectData is the only think that does anything. I looked in FB and tried to find a place to give Owner the right to post but I don't see that option.
Coordinator
Dec 17, 2015 at 3:39 PM
Thanks kilasuit and charlyRoot. I'll have to think about how to deal with the new change. I'm open to suggestions.