Cara buat aplikasi Facebook

Langkah 1: Daftar akaun Facebook  [tekan sini]


Langkah 2: Masuk kumpulan pembangun aplikasi Facebook [tekan sini]


Langkah 3: Mula


s1

*tekan butang Set Up New Application


s2

*A: beri nama aplikasi

*B: aktifkan butang yang berlabel “Agree”

*C: tekan butang “Create Application”


s3a

*masuk bahagian tetapan “Canvas”


s3b

*A: lengkapkan alamat capaian ke aplikasi anda

*B: beri alamat rujukan untuk memanggil fungsian aplikasi

*C: pilih FBML

*tekan “Save Changes”


s2b

*buka halaman tetapan aplikasi anda dari “My Applications”


s4a

*tekan pautan yang bernama “example code!”


s4b

*A: muat turun fail dari pautan itu

*B: salin semua aturcara dalam ruangan itu

*C: (tekan situ untuk lihat aplikasi anda)

*D: tekan butang “Done”


Langkah 4: SETUP dalam direktori aplikasi

s5

*pastikan direktori aplikasi anda seperti yang dipaparkan dalam gambar di atas


Langkah 5: Masukkan aturcara

*masukkan aturcara ke dalam fail “index.php”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
// Copyright 2007 Facebook Corp.  All Rights Reserved. 
// // Application: Contoh Aplikasi// File: 'index.php' 
//   This is a sample skeleton for your application. 
 
require_once('facebook-platform/php/facebook.php');
$appapikey = 'f6401da799e14650fa3df7829bb6dc82';
$appsecret = 'c754961c590a792690672c9c0e1b0dc9';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
 
// Greet the currently logged-in user!
echo "<p>Hello, <fb:name uid=\"$user_id\" useyou=\"false\" />!</p>";
 
// Print out at most 25 of the logged-in user's friends,
// using the friends.get API method
echo "<p>Friends:";$friends = $facebook->api_client->friends_get();
$friends = array_slice($friends, 0, 25);
foreach ($friends as $friend) {  echo "<br>$friend";}
echo "</p>";



Kalo idea apa-apa boleh kongsi. Semoga berjaya!!!


Incoming search terms:

2 comments

  1. Faiz says:

    bagus2, menarik. ana sokong. lepas ni bleh la buat applikasi sendiri dalam facebook.

    satu lg, appapikey dan appsecret tu sepatutnya jgn ditunjukkan pd orang lain kan. x palah, yg ni sekadar cth. hehe…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Upload Files

You can include images or files in your comment by selecting them below. Once you select a file, it will be uploaded and a link to it added to your comment. You can upload as many images or files as you like and they will all be added to your comment.

Spam Protection by WP-SpamFree