Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Push Development

Reply
New Developer
sharath_moblie
Posts: 104
Registered: ‎09-25-2013
My Device: BB 10
My Carrier: BB 10

BB 10 push notifications not working

[ Edited ]

Hi All,

 

I am developing a push enabled application in BB 10 cascades and Itegrated "Push Collector" App to my App.

 

and my Itegrstion is as follows,

 

1. 
void ConfigurationDAO::save(const Configuration &config)
{
QSettings settings;//http://cp(your App ID ).pushapi.eval.blackberry.com
settings.beginGroup(QSETTINGS_CONFIG_GROUP);
settings.setValue(PPG_URL_KEY, "http://cpXXXX.pushapi.na.blackberry.com");
settings.setValue(PROVIDER_APP_ID_KEY, "XXXX-XXXXXXXXXXXXXXXXXXXXXXX");
settings.setValue(PUSH_INITIATOR_URL_KEY,"");// made empty because Push Service SDK is not used for Push Initiator
settings.setValue(USING_PUBLIC_PPG_KEY, true);// true if using BIS as PPG Gate Way and not BB Enterprise
settings.setValue(LAUNCH_APP_ON_PUSH_KEY, true);
settings.endGroup();
// qDebug()<<"Configuration Saved ::: ConfigurationDAO::save()";
}

2. 
Configuration& ConfigurationDAO::configuration()
{
QSettings settings;
settings.beginGroup(QSETTINGS_CONFIG_GROUP);
m_config.setPpgUrl(settings.value(PPG_URL_KEY, "http://cpXXXX.pushapi.na.blackberry.com").toString());
m_config.setProviderApplicationId(settings.value(PROVIDER_APP_ID_KEY, "XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXX").toString());
m_config.setPushInitiatorUrl(settings.value(PUSH_INITIATOR_URL_KEY, "").toString());// server side URL
m_config.setUsingPublicPushProxyGateway(settings.value(USING_PUBLIC_PPG_KEY, true).toBool());// true if using BIS as PPG Gate Way and not BB Enterprise
m_config.setLaunchApplicationOnPush(settings.value(LAUNCH_APP_ON_PUSH_KEY, true).toBool());
settings.endGroup();
return m_config;
}
3.
void UserDAO::save(const User &user)
{
QSettings settings;
settings.beginGroup(QSETTINGS_USER_GROUP);
settings.setValue(USER_ID_KEY, "XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
settings.setValue(USER_PASSWORD_KEY, "http://cpXXXX.pushapi.na.blackberry.com");
//http://cp(your App ID ).pushapi.eval.blackberry.com
settings.endGroup();
}

 and my 

void RegisterService::subscribeToPushInitiator(const User& user, const QString& token)
{
    // Keep track of the current user's information so it can be stored later
    // on a success
    m_currentUser = user; // passed from App::onCreateChannelCompleted
 
    const Configuration config = m_configurationService.configuration();// go to ConfigurationDAO.cpp where giving PPG URL etc
 
    QUrl url(config.pushInitiatorUrl() + "/subscribe");
 
    url.addQueryItem("appid",config.providerApplicationId());// need to change (static way)
 
    url.addQueryItem("address",token);// don't know(passed from App::onCreateChannelCompleted)
 
    url.addQueryItem("osversion",deviceVersion());
    url.addQueryItem("model",deviceModel());
    url.addQueryItem("username",user.userId());
    url.addQueryItem("password",user.password());
 
    if (config.usingPublicPushProxyGateway()) {
        url.addQueryItem("type","public");// if  GATE WAY/Push Service is  not using  BlackBerry Enterprise Service
    } else {
        url.addQueryItem("type","bds");// if  GATE WAY/Push Service is lackBerry Enterprise Service
    }
 
    m_reply = m_accessManager.get(QNetworkRequest(url));
    // Connect to the reply finished signal.
    connect(m_reply, SIGNAL(finished()), this, SLOT(httpFinished()));
}
 

 

 Can anyone please verify what is going wrong here? how to fix the issue?

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: BB 10 push notifications not working

What's the issue? Could you provide some details on what is happening in your app vs what you are expecting to happen?

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.