私はアプリの共有アプリリンクにこれらのコードを使用しましたが、whatsappのテキストフィールドには何もありません。シンプルなテキストを使用している場合は、その仕事。誰も最終的な結果を提案することはできますか?whatsappを使ってリンクを共有する
NSString *theTempMessage = @"whatsapp://send?text=https://itunes.apple.com/in/app/myapp/id1054375332?ls=1&mt=8";
NSString *theFinalMessage;
theTempMessage = [theTempMessage stringByReplacingOccurrencesOfString:@":" withString:@"%3A"];
theTempMessage = [theTempMessage stringByReplacingOccurrencesOfString:@"/" withString:@"%2F"];
theTempMessage = [theTempMessage stringByReplacingOccurrencesOfString:@"?" withString:@"%3F"];
theTempMessage = [theTempMessage stringByReplacingOccurrencesOfString:@"," withString:@"%2C"];
theTempMessage = [theTempMessage stringByReplacingOccurrencesOfString:@"=" withString:@"%3D"];
theFinalMessage = [theTempMessage stringByReplacingOccurrencesOfString:@"&" withString:@"%26"];
NSString * stringToSend=theFinalMessage;
NSURL *whatsappURL = [NSURL URLWithString:stringToSend];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL])
{
[[UIApplication sharedApplication] openURL: whatsappURL];
}
なぜあなたは文字列の置換を使用しています – satheesh