Sla de code als massmessage.php kopen van 2 Definieer de Notification klasse als volgt : klasse Kennisgeving { Prive $ facebook ; Prive $ fbConfig = array ( ' api_key = > '' , ' secret_key ' = > '' ) ; } de bovenstaande code bepaalt ook de Facebook- configuratie-instellingen
3
Geef variabelen via code : . Prive $ MailMessage = '' ; Prive $ mailsubject = '' , Private $ melding = '' ;
4
Initialiseer de variabelen in functie " init " : $ this - > MailMessage = " HTML Message " ; $ this - > mailsubject = " E-mail " ; $ this - > melding = " Check it out " ;
5
Construct het facebook.php bestand : Include " facebook.php " ; $ this - > facebook = new Facebook ( $ this - > fbConfig [ ' api_key ' ] , $ this - > fbConfig [ ' secret_key ' ] $ this - > init ( ) ;
6
Stuur kennisgeving via de volgende functie : $ this - > , facebook - > api_client - > notifications_send ( $ id , $ this - > notificationMessage , $ this - > NotificationType ) ;
7
Stuur massa meldingen : $ notifObj = new Melding ( ) ; $ notifObj - > sendNotification ( '137373777 , 39344939 ' ) ; . . 137373777 is een van de user_id U kunt toevoegen , hooguit 100 gebruikers op een bepaald moment in de functie " sendNotification "