-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from OneSignal/get_ids
Add OneSignalId and ExternalId getters as well as a user changed observer
- Loading branch information
Showing
9 changed files
with
253 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
|
||
namespace OneSignalSDK.DotNet.Core.User | ||
{ | ||
public interface IUserState { | ||
/// <summary> | ||
/// The unique identifier for your OneSignal account. This will be an empty string until the | ||
/// user has been successfully logged in on the backend and assigned an ID. | ||
/// Use [Changed] to be notified when the [OneSignalId] has been successfully assigned. | ||
/// </summary> | ||
string OneSignalId { get; } | ||
|
||
/// <summary> | ||
/// The external identifier that you use to identify users. Use [Changed] to be notified | ||
/// when the [ExternalId] has been successfully assigned. This will be an empty string if no | ||
/// external identifier has been assigned to the associated [OneSignalId]. | ||
/// </summary> | ||
string ExternalId { get; } | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
OneSignalSDK.DotNet.Core/User/UserStateChangedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
|
||
namespace OneSignalSDK.DotNet.Core.User | ||
{ | ||
/// <summary> | ||
/// Several states associated with the SDK can be changed in and outside of the application. | ||
/// </summary> | ||
public class UserStateChangedEventArgs : EventArgs | ||
{ | ||
public UserChangedState State { get; } | ||
|
||
public UserStateChangedEventArgs(UserChangedState state) { | ||
State = state; | ||
} | ||
} | ||
|
||
public sealed class UserChangedState { | ||
public IUserState Current { get; } | ||
|
||
public UserChangedState(IUserState state) { | ||
Current = state; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters