Search code examples
delphiin-app-purchasein-app-billingdelphi-xe6

Error in setting ApplicationLicenseKey in TInAppPurchase in Delphi XE6


Based on embarcadero documentations here http://docwiki.embarcadero.com/RADStudio/XE6/en/Adding_In-App_Payments_to_Your_Mobile_Apps#Configuring_the_Connection_Data_for_Your_In-App_Payment_Service I tried to assign ApplicationLicenseKey, but I get this error [DCC Error] MainFrm.pas(413): E2056 String literals may have at most 255 elements. How can I solve this problem?


Solution

  • I found the solution the string literal can not exceed 255 chars, so I should break it into small pieces (each one less than 255 chars) and concat them.

    like this:

      InAppPurchase1.ApplicationLicenseKey := 
    'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqP'+
    '+hksdEZkVWseD9aQoI5RzaMnj0Ep+VUjXnZmVpVNzAmjdw9tS+'+
    'dHh3AcrEuUs9Hw9TtgaSCduBSiVuep5hM/UEnDVOnj8/ND8IJIOPj+'+
    'Yezrpbt+9W92LSkN3lNcm3weOz5IW2rUaw0PLLZx13PyLXMpOFe+uJ3aW9hcGl/'+
    'bDIMOeaFK9HWAGRTJGmmtfGUWQ0fe85mQXRwyrQncdoKLivHzKykzaR2wNuPBBLXpoHmEtIGGwnUFdAFUE8UqMQVepdtHVW9uNq/9e40lApkuQyoVKzZv31O56DF/'+
    'jMkuIwHry+0ZoRrGA3oxeZAUy/iKsTMwz+v8G0qJ8eIDdmtQIDAQAB';
    

    p.s. The thing is I just wrote like the sample in the embarcadero site.