- Home /
Question by
sona.viswam · Oct 17, 2013 at 11:29 AM ·
errorstringprime31
while passing to a function in Prime31 throws error
I have to use a function in Prime31 for requestiong product data in ios. The function is
var iosProductIds = new string[] { "com.something.dollar"};
IAP.requestProductData( iosProductIds, androidSkus, productList =>
{
Debug.Log( "Product list received" );
Utils.logObject( productList );
});
its working fine.
But if a extract a value from array named "pArray" and declared it as a variable
var pid = pArray [0];
and passing to function as
string[] stringArray = new string[1];
stringArray[0] =pid ;
var iosProductIds = stringArray;
throws error "StoreKit: invalid productIdentifier: com.something.dollar" .
I tried
string pid = pArray [0];
also. But stucked with same error.
How can i clear it? Please help
Comment
Best Answer
Answer by sona.viswam · Oct 18, 2013 at 07:03 AM
string pid = pArray [0];
string[] stringArray = new string[1];
stringArray[0] = pid .Trim();
var iosProductIds = stringArray;
works fine.
Your answer
![](https://koobas.hobune.stream/wayback/20220613120111im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can't access string in another script 2 Answers
BCE0022: Cannot convert 'String' to 'int'. 0 Answers
Fatal Error when opening Unity 1 Answer
Number 0 not showing up in GUI.Button 2 Answers
Webplayer String length fails? 1 Answer