refactor(android,ios): rename package com.timesafari to org.timesafari.dailynotification
- Android: move plugin source to org/timesafari/dailynotification, update namespace, manifest package, and all package/imports; change intent actions to org.timesafari.daily.NOTIFICATION and DISMISS - iOS: update bundle IDs, BGTask identifiers, subsystem labels, and queue names in Plugin and Xcode projects - Capacitor: update plugin class registration and appIds in configs - Test apps (android-test-app, daily-notification-test, ios-test-app): applicationId/bundleId, manifests, ProGuard, scripts, and docs - Docs: bulk update references; add CONSUMING_APP_MIGRATION_COM_TO_ORG.md for consuming app migration BREAKING CHANGE: Consuming apps must update plugin class to org.timesafari.dailynotification.DailyNotificationPlugin, manifest receivers/actions, and iOS BGTask identifiers per migration doc.
This commit is contained in:
@@ -106,7 +106,7 @@ npm run lint
|
||||
|
||||
## ADB Commands for Android Testing
|
||||
|
||||
**Package Name**: `com.timesafari.dailynotification.test`
|
||||
**Package Name**: `org.timesafari.dailynotification.test`
|
||||
|
||||
### Check Device Connection
|
||||
|
||||
@@ -136,7 +136,7 @@ Check if the app is installed:
|
||||
adb shell pm list packages | grep timesafari
|
||||
|
||||
# List only this app's package
|
||||
adb shell pm list packages com.timesafari.dailynotification.test
|
||||
adb shell pm list packages org.timesafari.dailynotification.test
|
||||
```
|
||||
|
||||
### Launch/Raise the App
|
||||
@@ -145,10 +145,10 @@ Launch the app or bring it to foreground:
|
||||
|
||||
```sh
|
||||
# Launch the main activity
|
||||
adb shell am start -n com.timesafari.dailynotification.test/.MainActivity
|
||||
adb shell am start -n org.timesafari.dailynotification.test/.MainActivity
|
||||
|
||||
# Launch with explicit intent
|
||||
adb shell am start -a android.intent.action.MAIN -n com.timesafari.dailynotification.test/.MainActivity
|
||||
adb shell am start -a android.intent.action.MAIN -n org.timesafari.dailynotification.test/.MainActivity
|
||||
```
|
||||
|
||||
### Uninstall App
|
||||
@@ -157,10 +157,10 @@ Remove the app from the device:
|
||||
|
||||
```sh
|
||||
# Uninstall by package name
|
||||
adb uninstall com.timesafari.dailynotification.test
|
||||
adb uninstall org.timesafari.dailynotification.test
|
||||
|
||||
# Force uninstall (if regular uninstall fails)
|
||||
adb shell pm uninstall -k --user 0 com.timesafari.dailynotification.test
|
||||
adb shell pm uninstall -k --user 0 org.timesafari.dailynotification.test
|
||||
```
|
||||
|
||||
### Additional Useful ADB Commands
|
||||
@@ -177,17 +177,17 @@ adb logcat -c
|
||||
**Check App Info**:
|
||||
```sh
|
||||
# Get app version and info
|
||||
adb shell dumpsys package com.timesafari.dailynotification.test | grep -A 5 "versionName\|versionCode"
|
||||
adb shell dumpsys package org.timesafari.dailynotification.test | grep -A 5 "versionName\|versionCode"
|
||||
```
|
||||
|
||||
**Force Stop App**:
|
||||
```sh
|
||||
# Force stop the app (useful for testing recovery scenarios)
|
||||
adb shell am force-stop com.timesafari.dailynotification.test
|
||||
adb shell am force-stop org.timesafari.dailynotification.test
|
||||
```
|
||||
|
||||
**Clear App Data**:
|
||||
```sh
|
||||
# Clear app data (resets to fresh install state)
|
||||
adb shell pm clear com.timesafari.dailynotification.test
|
||||
adb shell pm clear org.timesafari.dailynotification.test
|
||||
```
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
namespace "com.timesafari.dailynotification.test"
|
||||
namespace "org.timesafari.dailynotification.test"
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
defaultConfig {
|
||||
applicationId "com.timesafari.dailynotification.test"
|
||||
applicationId "org.timesafari.dailynotification.test"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 1
|
||||
|
||||
@@ -32,58 +32,58 @@
|
||||
}
|
||||
|
||||
# Keep DailyNotification plugin classes
|
||||
-keep class com.timesafari.dailynotification.** { *; }
|
||||
-keep class org.timesafari.dailynotification.** { *; }
|
||||
|
||||
# Keep plugin method names and signatures
|
||||
-keepclassmembers class com.timesafari.dailynotification.DailyNotificationPlugin {
|
||||
-keepclassmembers class org.timesafari.dailynotification.DailyNotificationPlugin {
|
||||
public *;
|
||||
}
|
||||
|
||||
# Keep all plugin manager classes
|
||||
-keep class com.timesafari.dailynotification.*Manager { *; }
|
||||
-keep class com.timesafari.dailynotification.*Storage { *; }
|
||||
-keep class com.timesafari.dailynotification.*Receiver { *; }
|
||||
-keep class org.timesafari.dailynotification.*Manager { *; }
|
||||
-keep class org.timesafari.dailynotification.*Storage { *; }
|
||||
-keep class org.timesafari.dailynotification.*Receiver { *; }
|
||||
|
||||
# Keep Room database classes
|
||||
-keep class com.timesafari.dailynotification.storage.** { *; }
|
||||
-keep class com.timesafari.dailynotification.database.** { *; }
|
||||
-keep class org.timesafari.dailynotification.storage.** { *; }
|
||||
-keep class org.timesafari.dailynotification.database.** { *; }
|
||||
|
||||
# Keep error handling classes
|
||||
-keep class com.timesafari.dailynotification.*Error* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Exception* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Error* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Exception* { *; }
|
||||
|
||||
# Keep JWT and ETag managers
|
||||
-keep class com.timesafari.dailynotification.*JWT* { *; }
|
||||
-keep class com.timesafari.dailynotification.*ETag* { *; }
|
||||
-keep class org.timesafari.dailynotification.*JWT* { *; }
|
||||
-keep class org.timesafari.dailynotification.*ETag* { *; }
|
||||
|
||||
# Keep performance and optimization classes
|
||||
-keep class com.timesafari.dailynotification.*Performance* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Optimizer* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Performance* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Optimizer* { *; }
|
||||
|
||||
# Keep rolling window and TTL classes
|
||||
-keep class com.timesafari.dailynotification.*Rolling* { *; }
|
||||
-keep class com.timesafari.dailynotification.*TTL* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Rolling* { *; }
|
||||
-keep class org.timesafari.dailynotification.*TTL* { *; }
|
||||
|
||||
# Keep exact alarm and reboot recovery classes
|
||||
-keep class com.timesafari.dailynotification.*Exact* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Reboot* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Recovery* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Exact* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Reboot* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Recovery* { *; }
|
||||
|
||||
# Keep enhanced fetcher classes
|
||||
-keep class com.timesafari.dailynotification.*Enhanced* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Fetcher* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Enhanced* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Fetcher* { *; }
|
||||
|
||||
# Keep migration classes
|
||||
-keep class com.timesafari.dailynotification.*Migration* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Migration* { *; }
|
||||
|
||||
# Keep channel manager
|
||||
-keep class com.timesafari.dailynotification.ChannelManager { *; }
|
||||
-keep class org.timesafari.dailynotification.ChannelManager { *; }
|
||||
|
||||
# Keep permission manager
|
||||
-keep class com.timesafari.dailynotification.PermissionManager { *; }
|
||||
-keep class org.timesafari.dailynotification.PermissionManager { *; }
|
||||
|
||||
# Keep scheduler classes
|
||||
-keep class com.timesafari.dailynotification.*Scheduler* { *; }
|
||||
-keep class org.timesafari.dailynotification.*Scheduler* { *; }
|
||||
|
||||
# =============================================================================
|
||||
# Android System Classes
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.getcapacitor.myapp;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
|
||||
assertEquals("com.getcapacitor.app", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.timesafari.dailynotification;
|
||||
package org.timesafari.dailynotification;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@@ -28,23 +28,23 @@
|
||||
|
||||
<!-- DailyNotification Plugin Components -->
|
||||
<receiver
|
||||
android:name="com.timesafari.dailynotification.DailyNotificationReceiver"
|
||||
android:name="org.timesafari.dailynotification.DailyNotificationReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.timesafari.daily.NOTIFICATION" />
|
||||
<action android:name="org.timesafari.daily.NOTIFICATION" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- NotifyReceiver for AlarmManager-based notifications -->
|
||||
<receiver
|
||||
android:name="com.timesafari.dailynotification.NotifyReceiver"
|
||||
android:name="org.timesafari.dailynotification.NotifyReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:name="com.timesafari.dailynotification.BootReceiver"
|
||||
android:name="org.timesafari.dailynotification.BootReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:directBootAware="true">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.timesafari.dailynotification.test;
|
||||
package org.timesafari.dailynotification.test;
|
||||
|
||||
import com.getcapacitor.BridgeActivity;
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
package com.timesafari.dailynotification.test;
|
||||
package org.timesafari.dailynotification.test;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import com.timesafari.dailynotification.DailyNotificationPlugin;
|
||||
import com.timesafari.dailynotification.NativeNotificationContentFetcher;
|
||||
import org.timesafari.dailynotification.DailyNotificationPlugin;
|
||||
import org.timesafari.dailynotification.NativeNotificationContentFetcher;
|
||||
|
||||
/**
|
||||
* Application class that registers native fetcher for testing
|
||||
@@ -32,7 +32,7 @@ public class TestApplication extends Application {
|
||||
// Register test native fetcher with application context
|
||||
Context context = getApplicationContext();
|
||||
NativeNotificationContentFetcher testFetcher =
|
||||
new com.timesafari.dailynotification.test.TestNativeFetcher(context);
|
||||
new org.timesafari.dailynotification.test.TestNativeFetcher(context);
|
||||
DailyNotificationPlugin.setNativeFetcher(testFetcher);
|
||||
|
||||
Log.i(TAG, "Test native fetcher registered: " + testFetcher.getClass().getName());
|
||||
@@ -8,15 +8,15 @@
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
package com.timesafari.dailynotification.test;
|
||||
package org.timesafari.dailynotification.test;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.timesafari.dailynotification.FetchContext;
|
||||
import com.timesafari.dailynotification.NativeNotificationContentFetcher;
|
||||
import com.timesafari.dailynotification.NotificationContent;
|
||||
import org.timesafari.dailynotification.FetchContext;
|
||||
import org.timesafari.dailynotification.NativeNotificationContentFetcher;
|
||||
import org.timesafari.dailynotification.NotificationContent;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonArray;
|
||||
@@ -2,6 +2,6 @@
|
||||
<resources>
|
||||
<string name="app_name">Daily Notification Test</string>
|
||||
<string name="title_activity_main">Daily Notification Test</string>
|
||||
<string name="package_name">com.timesafari.dailynotification.test</string>
|
||||
<string name="custom_url_scheme">com.timesafari.dailynotification.test</string>
|
||||
<string name="package_name">org.timesafari.dailynotification.test</string>
|
||||
<string name="custom_url_scheme">org.timesafari.dailynotification.test</string>
|
||||
</resources>
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { CapacitorConfig } from '@capacitor/cli';
|
||||
import { TEST_USER_ZERO_CONFIG } from './src/config/test-user-zero';
|
||||
|
||||
const config: CapacitorConfig = {
|
||||
appId: 'com.timesafari.dailynotification.test',
|
||||
appId: 'org.timesafari.dailynotification.test',
|
||||
appName: 'Daily Notification Test',
|
||||
webDir: 'dist',
|
||||
plugins: {
|
||||
|
||||
@@ -86,7 +86,7 @@ cd android
|
||||
adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
|
||||
# Launch app
|
||||
adb shell am start -n com.timesafari.dailynotification.test/.MainActivity
|
||||
adb shell am start -n org.timesafari.dailynotification.test/.MainActivity
|
||||
```
|
||||
|
||||
### iOS Build
|
||||
@@ -208,7 +208,7 @@ cd android
|
||||
|
||||
echo "📱 Installing and launching..."
|
||||
adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
adb shell am start -n com.timesafari.dailynotification.test/.MainActivity
|
||||
adb shell am start -n org.timesafari.dailynotification.test/.MainActivity
|
||||
|
||||
echo "✅ Android build and deploy complete!"
|
||||
```
|
||||
|
||||
@@ -24,7 +24,7 @@ The DailyNotification plugin is registered on the native Android side through:
|
||||
|
||||
1. **Automatic Discovery**: Using Capacitor's annotation processor
|
||||
2. **Manual Registration**: Fallback in `MainActivity.onCreate()`
|
||||
3. **Plugin Class**: `com.timesafari.dailynotification.DailyNotificationPlugin`
|
||||
3. **Plugin Class**: `org.timesafari.dailynotification.DailyNotificationPlugin`
|
||||
|
||||
### JavaScript Side (WebView)
|
||||
|
||||
@@ -71,7 +71,7 @@ node scripts/fix-capacitor-plugins.js
|
||||
cd android
|
||||
./gradlew :app:assembleDebug
|
||||
adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
adb shell am start -n com.timesafari.dailynotification.test/.MainActivity
|
||||
adb shell am start -n org.timesafari.dailynotification.test/.MainActivity
|
||||
```
|
||||
|
||||
### Why the Fix Script is Required
|
||||
@@ -85,7 +85,7 @@ adb shell am start -n com.timesafari.dailynotification.test/.MainActivity
|
||||
```javascript
|
||||
const PLUGIN_ENTRY = {
|
||||
name: "DailyNotification",
|
||||
classpath: "com.timesafari.dailynotification.DailyNotificationPlugin"
|
||||
classpath: "org.timesafari.dailynotification.DailyNotificationPlugin"
|
||||
};
|
||||
```
|
||||
|
||||
@@ -111,7 +111,7 @@ cat android/app/src/main/assets/capacitor.plugins.json
|
||||
[
|
||||
{
|
||||
"name": "DailyNotification",
|
||||
"classpath": "com.timesafari.dailynotification.DailyNotificationPlugin"
|
||||
"classpath": "org.timesafari.dailynotification.DailyNotificationPlugin"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -189,7 +189,7 @@ cd android
|
||||
|
||||
echo "📱 Installing and launching..."
|
||||
adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
adb shell am start -n com.timesafari.dailynotification.test/.MainActivity
|
||||
adb shell am start -n org.timesafari.dailynotification.test/.MainActivity
|
||||
|
||||
echo "✅ Build and deploy complete!"
|
||||
```
|
||||
|
||||
@@ -354,7 +354,7 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.timesafari.dailynotification.test;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.timesafari.dailynotification.test;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -373,7 +373,7 @@
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.timesafari.dailynotification.test;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.timesafari.dailynotification.test;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
<true/>
|
||||
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
||||
<array>
|
||||
<string>com.timesafari.dailynotification.fetch</string>
|
||||
<string>com.timesafari.dailynotification.notify</string>
|
||||
<string>org.timesafari.dailynotification.fetch</string>
|
||||
<string>org.timesafari.dailynotification.notify</string>
|
||||
</array>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
|
||||
@@ -285,7 +285,7 @@ if [ "$BUILD_ALL" = true ] || [ "$BUILD_ANDROID" = true ]; then
|
||||
log_info "APK installed successfully"
|
||||
|
||||
# Launch app
|
||||
if adb shell am start -n com.timesafari.dailynotification.test/.MainActivity; then
|
||||
if adb shell am start -n org.timesafari.dailynotification.test/.MainActivity; then
|
||||
log_info "✅ Android app launched successfully!"
|
||||
else
|
||||
log_warn "Failed to launch app (may already be running)"
|
||||
@@ -534,7 +534,7 @@ if [ "$BUILD_ALL" = true ] || [ "$BUILD_IOS" = true ]; then
|
||||
log_info "App installed on simulator"
|
||||
|
||||
# Launch app
|
||||
APP_BUNDLE_ID="com.timesafari.dailynotification.test"
|
||||
APP_BUNDLE_ID="org.timesafari.dailynotification.test"
|
||||
if xcrun simctl launch "$SIMULATOR_UDID" "$APP_BUNDLE_ID"; then
|
||||
log_info "✅ iOS app launched successfully!"
|
||||
else
|
||||
|
||||
@@ -26,7 +26,7 @@ const PODFILE_PATH = path.join(__dirname, '../ios/App/Podfile');
|
||||
|
||||
const PLUGIN_ENTRY = {
|
||||
name: "DailyNotification",
|
||||
classpath: "com.timesafari.dailynotification.DailyNotificationPlugin"
|
||||
classpath: "org.timesafari.dailynotification.DailyNotificationPlugin"
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user