Has Facebook's API changed recently? - php

I built a project last year that had some basic facebook features, such as fetching a user's name, email, and importing his friends. That project is still working, however the client contacted me to tell me that Facebook's API has changed and I need to update the code before the legacy support goes away.
I can't find any mention of such changes, can someone point me to see what has changed and how I can update the code?

You may follow next topics to get informed about API and functionality changes:
Change Log
Developer Roadmap
Completed Changes

Related

AWS Alexa skill linking with oauth 2

Hello to all
I am new in Amazon Alexa, I have a work to Alexa Skill account linking using PHP with oauth 2.0.
I have successfully configured all and also get code for Auth Code Grant but when I run my code in Chrome Browser it is generating Account linking Failed issue but when I run same URL in Firefox it generates Amazon linking failed with ERROR=missing-state.
Please help me to resolve my issue, any help would be highly appreciated.
Implementing Account Linking is tricky at times. The thing is at some point what happens between Alexa and the OAuth2 server is transparent for the Skill (Lambda), for example the process of refreshing a token among others, that is why I suggest you take a look at the references cited below.
Also because of the error shown, it seems that the parameter code is missing in one of the URLs exchanged back and forth between either the Alexa web console or Alexa mobile app and the OAuth2 server. Please verify it is always the same and is always present in the URLs. Implementing a proxy for sure will help on debugging this issue.
I would suggest you take a look at these great sources:
Debugging Account Linking
Using API Gateway to Debug Account Linking issues
I hope this helps somehow.
Cheers

Google calendar php api

After hours of work I am stuck with using google calendar php api, I need the basic functionality, reading and adding events (updating and removing later), any advice? I need the solution that works with the recent version of the api and is relatively simple.
Everything you need is well documented on Google Developers website. You will need composer to be running in your project and a Google Account.
On Google Developers page listed above, click Enable the Google Calendar API, select existing project or create a new one and click next. You will get your Client ID and unique Client Secret. You can manage this credentials in API Dashboard. Download these credentials.json and put them in your workdir.
Then you can setup composer for Google Client Library
composer require google/apiclient:^2.0
Now you can set up the sample. Create a file named quickstart.php and put there this code. You can run the sample using php quickstart.php.
Would you like to share your code with us, so we will be able to support you with more relevant answers?

php: Need explanation on creating a google calendar crawling cron job

In essence it seems like I don't understand the proper process of authenticating a cron service.
What I am trying to do:
I want to collect all events in a google calendar and store it in a mysql database. Sounds simple, but I've spent hours today trying to figure this out and have only gotten confused.
I've tried running
https://www.googleapis.com/calendar/v3/calendars/{CalendarId}/events?key={PublicAPIaccessKey}
hoping that it would work since the calendar is open to read access for everyone.
The response was
"Access Not Configured. Please use Google Developers Console to activate the API for your project."
So I went into Google Developer Console and enabled Google Calendar.
It still reports the same error.
Then I tried using the PHP library for Google OAuth (that is currently working for authenticating my users), but I don't have an access token and this is not a "client", but a "service" I am creating.
I have read up on Google Service Accounts. But I haven't found a resource that explains how I can use this account. It almost seemed as if I needed to set up billing and pay for using this account? Which is out of the question.
I am at a loss on how to proceed. I will continue to google and try to figure it out, but if someone can please explain this for me it would be greatly appreciated.
Try to follow the steps on service account creation here: https://developers.google.com/drive/web/delegation#create_the_service_account_and_its_credentials

Login with Google Plus on My Website

I'm very new to web development. I have searched for login with Google plus and found several good tutorials. But they seems to be very old (most of them from 2011). Why?
I tried below code chunks.
<script type="text/javascript" language="javascript">
$("#packagesGrid").load('https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=ya29.ahes6zt9yv2qaeej5ycn21fn9maokp15scwqkcal3guqxxez7odtjg&token_type=bearer&expires_in=3600');
</script>
I just manually copy pasted the token to the url on the jQuery load function. But nothing is filled to the page.
Google APIs use the OAuth 2.0 protocol for authentication and authorization. Google supports several OAuth 2.0 flows that cover common web server, JavaScript, device, installed application, and server to server scenarios. The Previous Versions of OAuth has been deprecated by Google.
Here is how it works : https://developers.google.com/accounts/docs/OAuth2
To Get Started with Coding,
https://code.google.com/p/google-plus-php-starter/
Just download the project and Follow the steps mentioned.
I have tried this recently and it's working 100% fine.
I'm in a Google presentation at the moment and apparently they have just launched Google+ sign-in, which allows you to do stuff like this much more elegantly.
I don't know any more about it than that, really, but it certainly seems worth a look.
I would suggest making use of the following tutorial Login with Google Account OAuth. It explains calling the correct methods and saves the user data to your database. Plus it was published today.
For this you have to use google client Api library for php
and after that, you need to generate some key (like client id, client secret key, simple API key for Google)
then you have to use these API and use the keys generated. You can find the complete procedure and documents at there corresponding websites...
If you neeed the working tutorial.

Apple push notification with an enterprise application

we have developed an application that use push notifications by following the very good guide created by David Mytton.
The push service worked great on the development profile. But now that it is finished we have changed to the customers distribution profile. The application is an in-house application using an Enterprise account.
We have changed the certificate on the server and we have changed to the production url as specified in the tutorial. We have also replaced the profile used when building the application and installed it to the tester iPhone. Everything seems to work on the server, and no error messages is returned but the push is never recieved on the iPhone. We are pretty clueless right now and don't know where to start debugging on this. We have checked that the tokenId is updated after replacing the profile.
Has anyone any experience in this and might know what's wrong or where to start debugging? Thanks!
I have no idea what was wrong here but i finally got it to work..
After hours of debugging without results i threw in the towel and created a new developer certificate, app id, push sertificate and distribution profile. I cleaned the project added the new profile and replaced all files on server.
And it worked! No problems at all... Sometimes i hate being an iPhone/Apple developer :\
A few things that you could try:
Make sure your phone is plugged in to a power source (sometimes not having this causes delayed notifications).
Use the following PHP library:
http://code.google.com/p/php-apns/
This allows you to debug the communication with the server and see where the error occurs. Specifically it allows you to debug if your token id is incorrect.
You could try using an incorrect token id on the server and see the behavior. Compare this with using the correct token id.
Any in-house distribution profile gives out a same tokenID, how ever
this tokenID varies across different devices.
Other only issue could be only with the ProductionURL.
I have also notices that the push notification reception is delayed sometimes, mostly when used with production URL.
Hope this helps.

Categories