Viral marketing with send to a friend

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Created: kevin_s2f (30 Sep 2008)
Last edited: hamishwillee (26 Jul 2012)
The we:offset application allows consumers to offset the carbon footprint of their travel using their mobile device. The application includes a "share with a friend" feature accessed from the left soft key and used to allow consumers to encourage their friends to download the application. Here is the code behind that feature:
void CEcoFlyerContainerBase::ShareWithFriendsL()
CSendUi* sendUi = CSendUi::NewLC();
CMessageData* data = CMessageData::NewL();
CleanupStack::PushL( data );
HBufC* text = HBufC::NewLC( 512 );
text->Des().AppendFormat( *StringLoader::LoadLC( R_LOC_SMS_SHARING), &KEcoFlyerDownloadLink, &_L( "" ) );
CRichText* richText = CRichText::NewL(
iEikonEnv->SystemParaFormatLayerL(), iEikonEnv->SystemCharFormatLayerL() );
CleanupStack::PushL( richText );
richText->InsertL( 0, text->Des() );
data->SetBodyTextL( richText );
sendUi->CreateAndSendMessageL( KUidMsgTypeSMS, data );
CleanupStack::PopAndDestroy( 4 );
This page was last modified on 26 July 2012, at 08:06.
35 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.