Skip to content

Does anyone knows how to implement Device linking?Β #233

@LokiMidgard

Description

@LokiMidgard

I try to add device linking (as master device) to this client. But I'm not sure how the API works.

I suspect that profileKey is the SignalingKey in the App.Handle.Store and that the identityKeyPair I need is the App.Handle.Store.IdentityKeyPair.

I also think I decode the uri correctly.

        public async Task AddDevice(Uri uri)
        {
            var code = await App.Handle.AccountManager.GetNewDeviceVerificationCodeAsync();

            var toAdd = DeviceProtocoll.FromUri(uri);
            // is the SignalingKey the profileKey???
            var profileKey = Base64.Decode(App.Handle.Store.SignalingKey);
            var identityKeyPair = new IdentityKeyPair(Base64.Decode(App.Handle.Store.IdentityKeyPair));

            try
            {
                // I'm not sure where which parameter goes...
                // but it failes when the QR code is to old, so the first two are propably correct...
                await App.Handle.AccountManager.AddDeviceAsync(toAdd.Uuid, toAdd.PublicKey,
                         identityKeyPair,
                        profileKey,
                         code);
            }
            catch (libsignalservice.push.exceptions.NotFoundException)
            {
                // ToDo: Handle Divice not found
            }
        }

The Android code doesn't do much more, besides enabling MultiDevice. Which I can't find anywhere...

Still nothing happens on my WindowsPhone when I scan its code. An error is also not raised (unless the QR code is to old).

You can also see the pullrequest #232

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions