OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
625 stars 214 forks source link

[Fix] Remove email and remove sms #805

Closed shepherd-l closed 11 months ago

shepherd-l commented 11 months ago

Description

One Line Summary

Fixes removeEmail calls on Android and iOS and removeSms calls on iOS

Details

Motivation

Fixes errors when calling removeEmail on Android and iOS and removeSms on iOS

Scope

No changes to the public API as fixes apply to native calls to OneSignal Android and iOS SDKs

Call arguments for removeEmail and removeSms do not have defined keys in user.dart and calling with a key returns an error on iOS. Fix could be done one of 2 ways:

  1. Remove the key value in OSFlutterUser.m
    • What was done in this PR
  2. Add the key value defined in OSFlutterUser.m (@"email", @"smsNumber") to user.dart
    • This also requires the key value to be added to Android in OneSignalUser.java

Testing

Manual testing

Tested removeEmail and removeSms on an user with emails and sms subscriptions and with none, app build of the OneSignal example app on on a emulated Pixel 4 with Android 12 and physical iPhone 12 with iOS 15.5.

Affected code checklist

Checklist

Overview

Testing

Final pass


This change is Reviewable