-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Hi I am using following piece of code and trying to upload .p12 or .p8 file it not upload in stream chat. Can anyone let me know what I am missing.
p12Data, err := readP12File("com.cadmiumcd.hmpconferences.p12") if err != nil { return fmt.Errorf("failed to read P12 file: %v", err) } // Parse certificate to extract details cert, err := parsePEMCertificate(pemData) if err != nil { return fmt.Errorf(ErrMsgParseCertificate, err) } pushProviderConfig := &stream_chat.PushProvider{ Name: "apn-provider-name-" + eventData.ClientID, Description: "APN Certificate for " + eventData.ClientName, Type: stream_chat.PushProviderAPNS, APNAuthKey: string(p12Data), APNKeyID: fmt.Sprintf("%X", cert.AuthorityKeyId), APNTeamID: string(cert.SubjectKeyId), // Alternative way if needed APNTopic: data[0].BundleID, } // Upload the APN certificate to Stream Chat _, err = client.UpsertPushProvider(context.Background(), pushProviderConfig) if err != nil { return fmt.Errorf("failed to upload APN certificate: %v", err) }