Skip to content

Conversation

@yasicmd
Copy link

@yasicmd yasicmd commented Aug 4, 2025

This PR solves issue #26 by allowing users to override the media3Version from 1.1.1 to 1.4.1 via app.json configuration, resolving Kotlin compilation errors when using CleverTap with react-native-video.

  • Add DependencyVersions interface for Android dependency overrides
  • Implement deep merge logic for user configuration with defaults
  • Add smart plugin directory detection for local development scenarios
  • Create comprehensive documentation with examples and troubleshooting
  • Add TypeScript support with full IntelliSense

Features:

  • Override any Android dependency version via app.json
  • Backwards compatible - existing configurations continue to work
  • Type-safe configuration with validation

Benefits:

  • Resolve Android dependency version conflicts with other packages
  • Future-proof version management without plugin updates
  • Comprehensive testing across multiple override scenarios

Note: iOS version overrides have known limitations (documented in README)

- Add DependencyVersions interface for Android dependency overrides
- Implement deep merge logic for user configuration with defaults
- Add smart plugin directory detection for local development scenarios
- Create comprehensive documentation with examples and troubleshooting
- Add TypeScript support with full IntelliSense

Features:
- Override any Android dependency version via app.json
- Backwards compatible - existing configurations continue to work
- Type-safe configuration with validation

Benefits:
- Resolve Android dependency version conflicts with other packages
- Future-proof version management without plugin updates
- Comprehensive testing across multiple override scenarios

Note: iOS version overrides have known limitations (documented in README)
@francispereira
Copy link

francispereira commented Aug 4, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

return defaults;
}

return {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasicmd Can you make this function dynamics, for example

function mergeDependencyVersions(defaults: Dependencies, overrides?: DependencyVersions): Dependencies {
    if (!overrides) {
        return defaults;
    }
    
    const result = {} as Dependencies;
    
    // Iterate through all keys in defaults
    for (const key in defaults) {
        result[key] = {
            ...defaults[key],
            ...(overrides[key] || {})
        };
    }
    
    return result;
}


const versionProperties = createVersionProperties(CLEVERTAP_DEPENDENCIES_DEFAULT_VERSIONS);
// Merge user dependency version overrides with defaults
const mergedVersions = mergeDependencyVersions(CLEVERTAP_DEPENDENCIES_DEFAULT_VERSIONS, dependencyVersions);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasicmd avoid merging if dependencyVersions is not passed by user

- **Media Support:**
Enable `android.features.enableMediaForInAppsInbox` for video content in in-app messages and app inbox.

## 🚧 Known Limitations
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasicmd Remove this section.


The CleverTap Expo Plugin supports overriding Android dependency versions and iOS constants directly from your `app.json`, solving compatibility issues and providing version control flexibility.

### Key Benefits
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasicmd Remove key benefits section.

| iOS.notifications.iosPushAppGroup | string | This value should be set to to enable logging Push Impressions to dashboard. The user profile details should be saved in specified "app group". When push notification is received, the saved profile details will be used to log Push Impression to correct profile. | Default is null. (Should be set to log Push Impressions) |
| iOS.versions | IOSVersions | Optional. Override iOS constants like deployment target, device family, and bundle versions. See [Dependency Versions Guide](docs/DEPENDENCY_VERSIONS.md) for detailed configuration. | Default uses plugin-defined constants. |

## 🔧 Configurable Dependency Versions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasicmd Keep the formatting same, use #### Heading level 4


The CleverTap Expo Plugin supports configurable dependency versions, allowing you to override any Android dependency version or iOS constant from your `app.json` configuration. This feature solves compatibility issues between CleverTap and other packages and provides complete control over dependency versions.

## Current Status
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasicmd Delete text from Line 7 to Line 24

|----------|---------------|-------------|
| `googleAdId.playServicesAdsVersion` | `18.2.0` | Google Play Services Ads Identifier version |

### Tested Examples
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasicmd Delete text from Line 116 to Line 160

3. **No Action Required**: The plugin includes fallback logic for local development
4. **Extensions Created**: iOS extensions should still be created successfully despite the different path resolution

### Common Error Messages
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasicmd Delete text from Line 346 to Line 479

Copy link
Collaborator

@piyush-kukadiya piyush-kukadiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left few comments. Also raise PR to develop branch.

// await nseUpdater.updateNSEEntitlements(`group.${config.ios?.bundleIdentifier}.clevertap`)
await nseUpdater.updateNEBundleVersion(config.ios?.buildNumber ?? DEFAULT_BUNDLE_VERSION);
await nseUpdater.updateNEBundleShortVersion(config?.version ?? DEFAULT_BUNDLE_SHORT_VERSION);
await nseUpdater.updateNEBundleVersion(config.ios?.buildNumber ?? getDefaultBundleVersion(clevertapProps.ios?.versions?.defaultBundleVersion));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasicmd I tested the logic, but doesn't work fine if I don't provide config.version or config.ios?.buildNumber values

@jbagaresgaray
Copy link

Any updates of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants