Skip to content

Commit

Permalink
[notifications][android] fix notification categories in standalone ap…
Browse files Browse the repository at this point in the history
…ps (expo#10624)

* fix notification categories in standalone apps

* Update CHANGELOG.md
  • Loading branch information
cruzach authored Oct 16, 2020
1 parent 3cd0e7d commit d8f2521
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Package-specific changes not released in any SDK will be added here just before

### 🐛 Bug fixes

- Fix `NotificationsHandler` & `ExpoNotificationCategoriesModule` reading from the wrong SharedPreferences files, resulting in categories not being applied in Android standalone apps. ([#10624](https://github.com/expo/expo/pull/10624) by [@cruzach](https://github.com/cruzach))
- Set mIntentUri from intent in DetachActivity.onCreate to fix Linking.getInitialURL in Android standalone apps ([#10535](https://github.com/expo/expo/pull/10535) by [@esamelson](https://github.com/esamelson))
- Only update the splash screen when it receives update configuration values on iOS ([#10512](https://github.com/expo/expo/pull/10512) by [@brentvatne](https://github.com/brentvatne))
- Only update the splash screen when it receives update configuration values on Android ([#10522](https://github.com/expo/expo/pull/10522) by [@esamelson](https://github.com/esamelson))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import java.util.List;
import java.util.Map;

import expo.modules.notifications.notifications.categories.ExpoNotificationCategoriesModule;
import expo.modules.notifications.notifications.handling.NotificationsHandler;
import expo.modules.notifications.notifications.scheduling.NotificationScheduler;
import host.exp.exponent.kernel.ExperienceId;
import host.exp.exponent.utils.ScopedContext;
Expand Down Expand Up @@ -50,8 +52,10 @@ public List<NativeModule> createNativeModules(final ScopedContext scopedContext,
// Overriding expo-file-system FileSystemModule
moduleRegistry.registerExportedModule(new ScopedFileSystemModule(scopedContext));

// `NotificationScheduler` needs to share `SharedPreferences` object with the notifications services, we don't want to use scoped context.
// Certain notifications classes should share `SharedPreferences` object with the notifications services, so we don't want to use scoped context.
moduleRegistry.registerExportedModule(new NotificationScheduler(scopedContext.getBaseContext()));
moduleRegistry.registerExportedModule(new ExpoNotificationCategoriesModule(scopedContext.getBaseContext()));
moduleRegistry.registerExportedModule(new NotificationsHandler(scopedContext.getBaseContext()));

// Adding other modules (not universal) to module registry as consumers.
// It allows these modules to refer to universal modules.
Expand Down

0 comments on commit d8f2521

Please sign in to comment.