We are using MFP 8 which is in bluemix. We tried logging some custom logs to MFP analytics, but it is not getting captured. This is a Cordova app. And there are no error logs also while sending logs to analytics server. As I am new to this, any help would be greatly appreciated.
Make sure the App has connected successfully to MFP server before sending the custom data
Code should look like
WL.Analytics.log({"myKey" : "myValue"});
WL.Analytics.send();
View using Analytics console > Apps > Client Log Search - Click search button
Reference: Using Analytics API in Client Applications
Related
i have been trying to send whatsapp messages using cloud api, but its expecting to enable whatsapp_business_messaging permission which is by default disabled when associating with any app that has been created.
https://developers.facebook.com/docs/whatsapp/cloud-api/get-started#get-access-token.
i didn't find any documentation pertaining to enable the above mentioned permission. Kindly assist
Edited
WhatsApp cloud API is Now Public!
According to their docs,
To start using it for development prepose
Register as a Meta Developer
Enable two-factor authentication for your account
Create a Meta App: Go to developers.facebook.com > My Apps >
Create App. Select the "Business" type and follow the prompts on
your screen.
From the App Dashboard, click on the app you would like to connect
to WhatsApp. Scroll down to find the "WhatsApp" product and click
Set up.
the onboarding process performs the following actions:
our App is associated with the Business Manager that you chose
A WhatsApp test phone number is added to your business. You can use this test phone number to explore the WhatsApp Business Platform
without registering or migrating a real phone number.
for more info please refer to whatsapp cloud getting started docs
Yes, WhatsApp Cloud API is now public.
With the Cloud API, businesses can directly get access to WhatsApp Business API from Facebook, in minutes.
For more info check out this WhatsApp Cloud API Guide.
I recently made an open-source python wrapper for newly WhatsApp Cloud API to help developers easily get started, You really wanna have a look at it https://github.com/neurotech-HQ/heyoo.
Installation
pip install --upgrade heyoo
Here is the sample code to send a message ;
>>> from heyoo import WhatsApp
>>> messenger = WhatsApp('TOKEN', phone_number_id='104xxxxxx')
>>> messenger.send_template('hello_world', 'your number')
For Javascript developers please have a look into Heyhooh
Installation
npm install heyooh
Here how sending to send messages;
import WhatsApp from heyhooh
let messenger = new WhatsApp('TOKEN', phone_number_id='104xxxxxx')
messenger.send_template("hello_world", "255757xxxxxx")
For PHP Developers whatsappcloud-php
Installation
composer require zepson/whatsappcloud-php
Here how the code to send a message;
<?php
require_once 'vendor/autoload.php';
use zepson\Whatsapp\WhatsappClass;
$token = 'YOUR_META_WHATSAPP_APP_ACCESS_TOKEN';
$phone_number_id = '10726082513218961';
//send message
$tsap = new WhatsappClass( $phone_number_id, $token);
$sendtsap = $tsap->send_template('hello_world', '255654485755');
print_r($sendtsap);
I was trying to implement custom analytics. As given in this documentation
WL.Analytics.log({buttonPress: "buttonA"}, "press");
WL.Analytics.log({buttonPress: "buttonB"}, "press");
WL.Analytics.log({buttonPress: "buttonC"}, "press");
WL.Analytics.send();
I have observed that this analytics is not sent until I successfully login using one of our realms. Is this information correct? does custom analytics requires the user to be logged in. Or is this configuration issue.
I have made simple application using Ionic and cordova. Added Mobilefirst plugin in it. Also I have used security adapters in it ResourceAdapter and UserLogin Adapter which is provided by IBM.
Now I want to include push notification part in this project. So I have added push notificationMFP plugin in same project. Sender id and key in push settings. Added scope push.mobileclient also.
When I tried to call MFPPush.registerDevice javascript method I am getting failed to register device.
Failed to register device:"com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushException: Response: Status=404, Text: Error 404: SRVE0295E: Error reported: 404\n, Error Message: Not Found"
Also when App get initialized I can see in MFP console that particular device in devices list and when I login I can see user ID also get added in device information. So what is problem is something I am missing? Why device is not able to register for push?
The original issue in the question was resolved:
Yes. Now its working Its initialization issue. Just got it. Thnks.
The user then added a new issue via comments:
One more help I need. I am trying to send notification to particular User ID through MFP console. But device can not get any notification. But i cn see User ID against device id. So there is option to send to user id in console. But its not working for me
Unless you got an error in the console, this means that the notification in all likelyhood left the MobileFirst Server. From there there are numerous options why the sending will fail. See the Push Notifications Troubleshooting section.
Using v4.0.10 of Pushsharp (nuget package), I am getting error GCM Authorization Failed when sending push notifications to Android devices.
Seems the bug raised in issue 574 (https://github.com/Redth/PushSharp/issues/574 ) has been compiled into the nuget package, yet I'm still getting this error.
Could this be related to the introduction of Firebase Cloud Messaging?
Does anyone still have success using GCM?
As of right now, GCM is still usable. However, it is highly encouraged for new users to use FCM instead. Either way, for both GCM and FCM, you must use a Server Key generated from the Firebase Console. There is a visible note in the GCM docs saying:
Starting from Sept. 2016 new server key can only be created in the Firebase Console using the Cloud Messaging tab of the Settings panel. Existing projects that need to create a new server key can be imported in the Firebase console without affecting their existing configuration.
The Authorization error has been encountered by number of users, some also had an old project. See my answer here for more details.
The sender id used in the app code needs to match the sender id Firebase Cloud Message Console and its corresponding "Firebase Cloud Messaging token".
Thank you #AL for your help.
currently I working to implement Firebase Push Notification in my apps.
I found this:
[background] Using Firebase Console my apps can get the notification from system tray with remote notification
[foreground] Using Firebase Console my apps can get the notification from log, but i can make it into notification center with local notification
[foreground] Using Our Dashboard which managed by PHP serverside, I can get notification from log, but i can make it into notification center with local notification
The problem is, how can i get the notification (log is fine) if my apps in background with Our Dashboard which managed by PHP serverside?
I found that there is different between json I got from Firebase Console and our managed serverside dashboard, is that a problem that my apps cant handle? and how i can handle it? can I get the sample of the code to solve this problem?
This is the different between json i got from firebase console and our managed serverside dashboard
firebase console
our managed serverside dashboard
What you want to do is possible by using the normal FCM api.
Please review the differences between Display-Message and Data-Message here:
https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages
and see all the parameters in the reference page:
https://firebase.google.com/docs/cloud-messaging/http-server-ref