Jump to content

Dave Nottage

Members
  • Content Count

    1334
  • Joined

  • Last visited

  • Days Won

    29

Posts posted by Dave Nottage


  1. 21 hours ago, Dave Nottage said:

    I may have one in the next day or so.

    I have a workaround now which is implemented in the Codex and Mosco tools (or just using Mosco if you're OK with using the Mac to perform the fix)

     

    The tools with the workaround are presently in beta, and can be accessed via my Slack workspace which you can self-invite to here. (if not joined already). Go to the #codex channel and there is a pinned post with the installers for Codex and Mosco


  2. Oops.. it looks like something may have been missed. Can you add the following to the application node of AndroidManifest.template.xml:

            <meta-data
                android:name="com.google.android.play.billingclient.version"
                android:value="4.0.0" />

    ..and try again? If this fixes it, I'll file a report in the Quality Portal, unless you want to 🙂

     

    If it doesn't fix it, you might like to use this tool: https://github.com/skylot/jadx to look inside classes.dex in the project output folder, and make sure com.android.billingclient is in there. Perhaps do this first


  3. 3 hours ago, Raymond Ng said:

    Any workaround option available ?

    I may have one in the next day or so.

    3 hours ago, Raymond Ng said:

    As my App is crash in iPhone 13.

    That is likely to be a completely different issue. Does it happen on other iPhone models? Can you provide code that reproduces the problem? I have access to an iPhone 13 that I can test on.

    3 hours ago, Raymond Ng said:

    Is there any Xcode 12.x version that can support iPhone 13 with iOS15 ? 

    iOS 15.0 SDK comes with Xcode 13 (not earlier versions). I'm not sure if you can switch back to Xcode 12.5.1 and still build against iOS 15.0 SDK

    3 hours ago, Raymond Ng said:

    Is Delphi 11 support Xcode 13 ?

    The issue we've been discussing affects Delphi 11 and earlier. 

    • Like 1

  4. 7 hours ago, John van de Waeter said:

    1. The new Delphi 11 says the Android app will run on Android 8 and above.

    This would be bad news for my cutomers with Android 6 and 7

    It says the officially supported versions are Android 8 and above. That does not mean apps will not run on lower versions - I have apps built with Delphi 11 running on Android 4.4.

     


  5. I wish to use the App Store Connect REST API to retrieve some information, and I have created a key as per these instructions.

     

    Next thing is to create a JWT for passing in the Authorization as per these instructions. I have chosen Paolo Rossi's excellent JOSE JWT library for Delphi (especially since it now includes an ES256 signing algorithm), and have come up with the following code for generating the JWT and sending via HTTP:

    const
      cTokenExpirySeconds = 60;
      cIssuerID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx';
      cKeyID = 'yyyyyyyy';
      cAppStoreConnectAPIURL = 'https://api.appstoreconnect.apple.com/v1';
      cAppStoreConnectAPIGetProfiles = cAppStoreConnectAPIURL + '/profiles';
    
    // AIssuer = id obtained from https://appstoreconnect.apple.com/access/api
    // AKeyID = id associated with the key
    // ASecret = text read from the .p8 file
    function CreateJWT(const AIssuer, AKeyID, ASecret: string): string;
    var
      LJWT: TJWT;
      LSigner: TJWS;
      LKey: TJWK;
      // LScope: TJSONArray;
    begin
      LJWT := TJWT.Create;
      try
        LJWT.Header.Algorithm := 'ES256';
        LJWT.Header.KeyID := AKeyID;
        LJWT.Claims.Audience := 'appstoreconnect-v1';
        LJWT.Claims.Issuer := AIssuer;
        LJWT.Claims.IssuedAt := Now;
        LJWT.Claims.Expiration := IncSecond(Now, cTokenExpirySeconds);
        // LScope := TJSONArray.Create;
        // LScope.Add('GET /v1/profiles') ;
        // LJWT.Claims.JSON.AddPair('scope', LScope);
        LSigner := TJWS.Create(LJWT);
        try
          LSigner.SkipKeyValidation := False;
          LKey := TJWK.Create(ASecret);
          try
            LSigner.Sign(LKey, TJOSEAlgorithmId.ES256);
          finally
            LKey.Free;
          end;
          Result := LSigner.Payload + '.' + LSigner.Signature;
        finally
          LSigner.Free;
        end;
      finally
        LJWT.Free;
      end;
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
      LHTTP: THTTPClient;
      LResponse: IHTTPResponse;
      LToken: string;
    begin
      LToken := CreateJWT(cIssuerID, cKeyID, TFile.ReadAllText('Z:\Config\AppStoreConnectAPI\AuthKey.p8'));
      LHTTP := THTTPClient.Create;
      try
        LHTTP.CustomHeaders['Authorization'] := 'Bearer ' + LToken;
        LResponse := LHTTP.Get(cAppStoreConnectAPIGetProfiles);
        Memo1.Lines.Add(LResponse.ContentAsString);
      finally
        LHTTP.Free;
      end;
    end;

    The response is:

    {
    	"errors": [{
    		"status": "401",
    		"code": "NOT_AUTHORIZED",
    		"title": "Authentication credentials are missing or invalid.",
    		"detail": "Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens"
    	}]
    }

    So I assume I am missing something. According to the documentation, adding the scope (the code that is commented out) can be optional depending on the request. Adding the scope yields the same result in this case.

     

    Any clues as to what the problem may be?


  6. 12 hours ago, sjordi said:

    it's really the upgrade process that seems screwed

    With the direct download method I used, it took around 30-40 minutes total to update

    4 hours ago, billyb said:

    Should have asked before, Can update to Xcode 13 and sill use Delphi 10.4 or do I have to also update to Delphi 11?

    I'm using Xcode 13 also with Delphi 10.4.2 and it appears to be working OK, aside from the issue mentioned earlier about deploying for App Store when using Debug config.


  7. 6 hours ago, billyb said:

    Let me know how it goes with your update.

    After I updated my phone to iOS 15.0, the apps that were already on it, compiled with Delphi 10.4.2 using iOS 14.5 SDK, ran without any warnings.

     

    Xcode 13 is now installed, and I was able to import the iOS 15.0 SDK. EDIT: As per this report on Facebook:

     

    https://www.facebook.com/groups/137012246341854/posts/4389107827798920

     

    App Store builds using Xcode 13 FAIL. Dev builds are OK. I'm looking into why the App Store build fails

     

    EDIT 2: App Store builds work if Release config is selected. I'm pretty sure that in earlier versions of Xcode, it did not matter if Debug config was used.

     

    A word of warning about installing Xcode 13: When I used the App Store app on the Mac to update Xcode, it spent a couple of hours "stuck" at around the 95% mark. I ended up restarting my machine, and it went back to around 75%:

     

    image.thumb.png.ba2ad740aa6ce88150af83a6cfba8b25.png

     

    I waited another hour or so, and it did not move, so I gave up, and downloaded Xcode 13 from the developer site:

     

    https://developer.apple.com/download/release/

     

    The link to the released version of Xcode 13 seems to have disappeared from that link at the moment - hopefully it will re-appear. Anyway, I made a backup of Xcode 12.5.1 in my /Applications folder first, and after downloading Xcode 13, opened a command-line window and executed this:

     

    cd /Applications
    sudo xip -x [path_to_download]/Xcode_13.xip

    Where [path_to_download] is the path that I downloaded Xcode 13 to. This unarchives Xcode 13 into the /Applications folder. sudo is required for permissions to unarchive to /Applications

     

     

    • Like 2

  8. 3 hours ago, billyb said:

    One of my customers updated to IOS 15 and cannot run our FMX app

    Define "cannot run", as in - are there any errors? Does the app start?

    Incidentally, I'm updating my device today (backing it up with iOS 14.8 first) as well as checking out Xcode 13


  9. 1 hour ago, Lajos Juhász said:

    At run time it shows ok in the empty project.

    OK.. it may be a problem at runtime only in some circumstances, which includes running on a remote machine. Needs further investigation in that regard


  10. Steps to reproduce: (Delphi 10.4.2)

     

    1. Start new VCL app
    2. Put a TStatusBar on the form
    3. Right-click the TStatusBar, click Panels Editor..
    4. Click the "Add" button in the top left, 15 times (panels will be numbered 0 - 14)
    5. Save the project
    6. Close the form
    7. Re-open the form
    8. Check the appearance of the TStatusBar

    On the PCs I have tried this on, the status bar fails to draw correctly when first shown. If the status bar needs to repaint, all is OK. This happens both at design time and runtime.

     

    Might anyone know why this occurs, and is there a solution?


  11. This looks like two questions. The first part is not currently possible using Delphi code, since there's no option to use AccessibilityService (there is for a plain Service and JobIntentService)

    In order to use UssdResponseCallback you need to write Java code, since you need to create a descendant of it (this is otherwise not currently possible in Delphi), and override its methods. You could define a Java interface that the descendant takes as a parameter in its constructor, and uses to redirect the overridden methods, much like I have in the code here: https://github.com/DelphiWorlds/Kastri/tree/master/Java/Base/Connectivity
     

    This Java code would need to be compiled into a jar which the Delphi app can consume. You would need to import the Java code into Delphi code. Using the same example above, this is the corresponding Delphi import: https://github.com/DelphiWorlds/Kastri/blob/master/API/DW.Androidapi.JNI.DWNetworkCallback.pas

    The next step is to construct a class that implements the interface defined earlier. Following the same example, that is TNetworkCallbackDelegate in this unit: https://github.com/DelphiWorlds/Kastri/blob/master/Features/Connectivity/DW.Connectivity.Android.pas

    You would then create an instance of the "delegate", and pass a reference to that when creating an instance of the descendant. Again following the above example, it would be similar to the code here: https://github.com/DelphiWorlds/Kastri/blob/82da3db3d0a526f6e93a30f3eb1a6c14779399bb/Features/Connectivity/DW.Connectivity.Android.pas#L98

     

    • Like 1

  12. 2 hours ago, CHackbart said:

    I suppose something like keyResponse := TAVContentKeyResponse.Wrap(crcData) is not correct, right?

    It's not correct. It needs to be:

    keyResponse := TAVContentKeyResponse.Wrap(TAVContentKeyResponse.OCClass.contentKeyResponseWithFairPlayStreamingKeyResponseData(ckcData));

     

    2 hours ago, CHackbart said:

    And how do I fill a NSDictionary like options: [AVContentKeyRequestProtocolVersionsKey: [1]], 

    If it's an NSDictionary with only one object, this is an example using a typical pattern for that scenario:

    dict := TNSDictionary.Wrap(TNSDictionary.OCClass.dictionaryWithObject(TNSNumber.OCClass.numberWithInt(1), NSObjectToID(AVContentKeyRequestProtocolVersionsKey));

    When there's more than one value to add, one way is to create an instance of NSMutableDictionary, and use the setValue method. There's a couple of examples in FMX.AddressBook.iOS

    2 hours ago, CHackbart said:

    assetIDData = assetIDString.data(using: .utf8)

     

    assetIDData := assetIDString.dataUsingEncoding(NSUTF8StringEncoding);

     


  13. 1 hour ago, CHackbart said:

    FContentKeySession.addContentKeyRecipient(FAsset)

    Should be:

    FContentKeySession.addContentKeyRecipient(NSObjectToID(FAsset))

    You shouldn't need to use a TTask in the code there, either. I had issues compiling your test project, so I started a new one, and just added the form from the original project to it.


  14. 5 hours ago, Rollo62 said:

    Stupid question, is it possible that Win and Macos have different format setting ?

    Well, they're obtained differently, since they're different operating systems. The problem here is either in the call to CFLocaleCopyCurrent or CFLocalGetValue, which is what Delphi currently uses to obtain the decimal separator. The decimalSeparator method of NSLocale gives the correct result.

    • Like 1
×