Skip to content

Commit e7c9594

Browse files
authored
Merge pull request #1764 from OneSignal/user-model/pascal-case-areas
Update high level components to be accessed via pascal case
2 parents 4172f8b + 822eb71 commit e7c9594

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

MIGRATION_GUIDE.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ The OneSignal SDK has been updated to be more modular in nature. The SDK has be
5959
| Namespace | Module | Kotlin | Java |
6060
| ------------- | ----------------------------- | ------------------------- | ------------------------------ |
6161
| User | com.onesignal:core | `OneSignal.User` | `OneSignal.getUser()` |
62-
| Session | com.onesignal:core | `OneSignal.session` | `OneSignal.getSession()` |
63-
| Notifications | com.onesignal:notifications | `OneSignal.notifications` | `OneSignal.getNotifications()` |
64-
| Location | com.onesignal:location | `OneSignal.location` | `OneSignal.getLocation()` |
65-
| InAppMessages | com.onesignal:in-app-messages | `OneSignal.inAppMessages` | `OneSignal.getInAppMessages()` |
66-
| Debug | com.onesignal:core | `OneSignal.debug` | `OneSignal.getDebug()` |
62+
| Session | com.onesignal:core | `OneSignal.Session` | `OneSignal.getSession()` |
63+
| Notifications | com.onesignal:notifications | `OneSignal.Notifications` | `OneSignal.getNotifications()` |
64+
| Location | com.onesignal:location | `OneSignal.Location` | `OneSignal.getLocation()` |
65+
| InAppMessages | com.onesignal:in-app-messages | `OneSignal.InAppMessages` | `OneSignal.getInAppMessages()` |
66+
| Debug | com.onesignal:core | `OneSignal.Debug` | `OneSignal.getDebug()` |
6767

6868

6969

@@ -83,7 +83,7 @@ Initialization of the OneSignal SDK, although similar to past versions, has chan
8383
OneSignal.initWithContext(this, ONESIGNAL_APP_ID)
8484
// requestPermission will show the native Android notification permission prompt.
8585
// We recommend removing the following code and instead using an In-App Message to prompt for notification permission.
86-
OneSignal.notifications.requestPermission(true)
86+
OneSignal.Notifications.requestPermission(true)
8787

8888
If your integration is not user-centric, there is no additional startup code required. A user is automatically created as part of the push subscription creation, both of which are only accessible from the current device and the OneSignal dashboard.
8989

@@ -246,7 +246,7 @@ The user name space is accessible via `OneSignal.User` (in Kotlin) or `OneSignal
246246

247247

248248
**Session Namespace**
249-
The session namespace is accessible via `OneSignal.session` (in Kotlin) or `OneSignal.getSession()` (in Java) and provides access to session-scoped functionality.
249+
The session namespace is accessible via `OneSignal.Session` (in Kotlin) or `OneSignal.getSession()` (in Java) and provides access to session-scoped functionality.
250250

251251
| **Kotlin** | **Java** | **Description** |
252252
| ----------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------- |
@@ -256,7 +256,7 @@ The session namespace is accessible via `OneSignal.session` (in Kotlin) or `OneS
256256

257257

258258
**Notifications Namespace**
259-
The notification namespace is accessible via `OneSignal.notifications` (in Kotlin) or `OneSignal.getNotifications()` (in Java) and provides access to notification-scoped functionality.
259+
The notification namespace is accessible via `OneSignal.Notifications` (in Kotlin) or `OneSignal.getNotifications()` (in Java) and provides access to notification-scoped functionality.
260260

261261
| **Kotlin** | **Java** | **Description** |
262262
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -272,7 +272,7 @@ The notification namespace is accessible via `OneSignal.notifications` (in Kotli
272272

273273

274274
**Location Namespace**
275-
The location namespace is accessible via `OneSignal.location` (in Kotlin) or `OneSignal.getLocation()` (in Java) and provide access to location-scoped functionality.
275+
The location namespace is accessible via `OneSignal.Location` (in Kotlin) or `OneSignal.getLocation()` (in Java) and provide access to location-scoped functionality.
276276

277277
| **Kotlin** | **Java** | **Description** |
278278
| -------------------------------------------| -------------------------------------------------------------------| -------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -281,7 +281,7 @@ The location namespace is accessible via `OneSignal.location` (in Kotlin) or `On
281281

282282

283283
**InAppMessages Namespace**
284-
The In App Messages namespace is accessible via `OneSignal.inAppMessages` (in Kotlin) or `OneSignal.getInAppMessages()` (in Java) and provide access to in app messages-scoped functionality.
284+
The In App Messages namespace is accessible via `OneSignal.InAppMessages` (in Kotlin) or `OneSignal.getInAppMessages()` (in Java) and provide access to in app messages-scoped functionality.
285285

286286
| **Kotlin** | **Java** | **Description** |
287287
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -296,7 +296,7 @@ The In App Messages namespace is accessible via `OneSignal.inAppMessages` (in Ko
296296

297297

298298
**Debug Namespace**
299-
The debug namespace is accessible via `OneSignal.debug` (in Kotlin) or `OneSignal.getDebug()` (in Java) and provide access to debug-scoped functionality.
299+
The debug namespace is accessible via `OneSignal.Debug` (in Kotlin) or `OneSignal.getDebug()` (in Java) and provide access to debug-scoped functionality.
300300

301301
| **Kotlin** | **Java** | **Description** |
302302
| -------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/IOneSignal.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,33 @@ interface IOneSignal {
2828
/**
2929
* The session manager for accessing session-scoped management.
3030
*/
31-
val session: ISessionManager
31+
val Session: ISessionManager
3232

3333
/**
3434
* The notification manager for accessing device-scoped
3535
* notification management.
3636
*/
37-
val notifications: INotificationsManager
37+
val Notifications: INotificationsManager
3838

3939
/**
4040
* The location manager for accessing device-scoped
4141
* location management.
4242
*/
43-
val location: ILocationManager
43+
val Location: ILocationManager
4444

4545
/**
4646
* The In App Messaging manager for accessing device-scoped
4747
* IAP management.
4848
*/
49-
val inAppMessages: IInAppMessagesManager
49+
val InAppMessages: IInAppMessagesManager
5050

5151
/**
5252
* Access to debug the SDK in the event additional information is required to diagnose any
5353
* SDK-related issues.
5454
*
5555
* WARNING: This should not be used in a production setting.
5656
*/
57-
val debug: IDebugManager
57+
val Debug: IDebugManager
5858

5959
/**
6060
* Determines whether a user must consent to privacy prior

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/OneSignal.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,32 @@ object OneSignal {
5050
* has been called.
5151
*/
5252
@JvmStatic
53-
val session: ISessionManager
54-
get() = oneSignal.session
53+
val Session: ISessionManager
54+
get() = oneSignal.Session
5555

5656
/**
5757
* The notification manager for accessing device-scoped notification management. Initialized
5858
* only after [initWithContext] has been called.
5959
*/
6060
@JvmStatic
61-
val notifications: INotificationsManager
62-
get() = oneSignal.notifications
61+
val Notifications: INotificationsManager
62+
get() = oneSignal.Notifications
6363

6464
/**
6565
* The location manager for accessing device-scoped location management. Initialized
6666
* only after [initWithContext] has been called.
6767
*/
6868
@JvmStatic
69-
val location: ILocationManager
70-
get() = oneSignal.location
69+
val Location: ILocationManager
70+
get() = oneSignal.Location
7171

7272
/**
7373
* The In App Messaging manager for accessing device-scoped IAP management. Initialized
7474
* only after [initWithContext] has been called.
7575
*/
7676
@JvmStatic
77-
val inAppMessages: IInAppMessagesManager
78-
get() = oneSignal.inAppMessages
77+
val InAppMessages: IInAppMessagesManager
78+
get() = oneSignal.InAppMessages
7979

8080
/**
8181
* Access to debug the SDK in the additional information is required to diagnose any
@@ -84,8 +84,8 @@ object OneSignal {
8484
* WARNING: This should not be used in a production setting.
8585
*/
8686
@JvmStatic
87-
val debug: IDebugManager
88-
get() = oneSignal.debug
87+
val Debug: IDebugManager
88+
get() = oneSignal.Debug
8989

9090
/**
9191
* Determines whether a user must consent to privacy prior

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/internal/OneSignalImp.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ internal class OneSignalImp : IOneSignal, IServiceProvider {
7575
}
7676

7777
// we hardcode the DebugManager implementation so it can be used prior to calling `initWithContext`
78-
override val debug: IDebugManager = DebugManager()
79-
override val session: ISessionManager get() = if (isInitialized) _session!! else throw Exception("Must call 'initWithContext' before use")
80-
override val notifications: INotificationsManager get() = if (isInitialized) _notifications!! else throw Exception("Must call 'initWithContext' before use")
81-
override val location: ILocationManager get() = if (isInitialized) _location!! else throw Exception("Must call 'initWithContext' before use")
82-
override val inAppMessages: IInAppMessagesManager get() = if (isInitialized) _iam!! else throw Exception("Must call 'initWithContext' before use")
78+
override val Debug: IDebugManager = DebugManager()
79+
override val Session: ISessionManager get() = if (isInitialized) _session!! else throw Exception("Must call 'initWithContext' before use")
80+
override val Notifications: INotificationsManager get() = if (isInitialized) _notifications!! else throw Exception("Must call 'initWithContext' before use")
81+
override val Location: ILocationManager get() = if (isInitialized) _location!! else throw Exception("Must call 'initWithContext' before use")
82+
override val InAppMessages: IInAppMessagesManager get() = if (isInitialized) _iam!! else throw Exception("Must call 'initWithContext' before use")
8383
override val User: IUserManager get() = if (isInitialized) _user!! else throw Exception("Must call 'initWithContext' before use")
8484

8585
// Services required by this class

0 commit comments

Comments
 (0)