Apple Music Kit JS

Im trying to integrate Apples Music Kit into the app. But at auth in build version i get redirected to a browser tab. From there the app does not collect anything from session and i can’t get dev token. I tried use InAppBrowser package to override window.open to be in in app browser but there is no use in it. Inside apple’s script i found out that script creates a form via document.createElement(“form”)

ServiceSetupView.prototype._buildFormElement = function (e, t, r) {
        void 0 === t && (t = this.target), void 0 === r && (r = this.developerToken);
        var i = document.createElement("form");
        i.setAttribute("method", "post"), i.setAttribute("action", e), i.setAttribute("target", t), i.style.display = "none";
        var n = document.createElement("input");
        n.setAttribute("name", "jwtToken"), n.setAttribute("value", r), i.appendChild(n);
        var o = document.createElement("input");
        o.setAttribute("name", "isWebPlayer"), o.setAttribute("value", "true"), i.appendChild(o);
        var a = document.createElement("input");
        return a.setAttribute("name", "LogoURL"), a.setAttribute("value", "test"), i.appendChild(a), i
      }

I tried to replace

 i.setAttribute("target", t)

with

 i.setAttribute("target", "_self")

and it did work in dev env when app launches in browser but on native build it still opens a system browser :confused:

If someone had such issue before and can help it would be great. Thanks!

1 Like

any further progress here? Thanks!

You are advised to use the Audio Converter for Windows from DRmare to download Apple Music songs. Then you can listen to them on your apps offline. The lossless music is easy to save and you can play the songs on your own players.