objective c - iOS - Pinterest Sharing Description Text not working if I send "&" in description text -
i had implemented pinterest sharing code in app well. working fine. problem arrives @ 1 scenario see follow
correct working:
[pinterest createpinwithimageurl:[nsurl urlwithstring:imageurl] sourceurl:[nsurl urlwithstring:[nsstring stringwithformat:@"%@",shareurl]] description:@"my description"];
then share pinterest description same my description per expectation.
but when send description test :
[pinterest createpinwithimageurl:[nsurl urlwithstring:imageurl] sourceurl:[nsurl urlwithstring:[nsstring stringwithformat:@"%@",shareurl]] description:@"my details & description"];
then share pinterest description my details. expected text here my details & description trunks string after & symbol.
what wrong happening me please @ here.
afaik, pinterest's pin sdk isn't open source, it's difficult find out what's going on.
i guess, however, method creating request under-the-hood that's incorrectly url encoding description
parameter (perhaps they're using stringbyaddingpercentescapesusingencoding
or other naive method).
i'd recommend contacting pinterest sdk developers/maintainers this.
as quick fix, might try url encoding &
yourself. example, might try replacing &
%26
, e.g.
nsstring *description = // ...whatever should set to... description = [description stringbyreplacingoccurrencesofstring:@"&" withstring:@"%26"];
however, might lead other problems pinterest sdk doing some sort of url encoding , encode %
symbol.
another naive approach may replace &
word and
, such as
nsstring *description = // ...whatever should set to... description = [description stringbyreplacingoccurrencesofstring:@"&" withstring:@"and"];
again, it's hacky, it's workaround bug that's in underlying sdk.
Comments
Post a Comment