Skip to content

Gameball Android SDK v3.0.2

Choose a tag to compare

@Ahmedelmonady Ahmedelmonady released this 29 Sep 15:11

Release Notes - Gameball React Native SDK

This file contains detailed release notes for the latest version. For complete version history, see CHANGELOG.md.


Latest Release: v3.0.2

Release Date: September 29, 2025
Version: 3.0.2
Type: Major Release


πŸŽ‰ What's New

Gameball React Native SDK v3.0.2 represents a complete modernization with modern React Native architecture, enhanced type safety, and developer-friendly TypeScript interfaces. This major release brings significant improvements to performance, reliability, and developer experience.

πŸ”§ Modern React Native Architecture

  • Complete TypeScript Migration: Entire SDK rewritten in TypeScript for better performance and type safety
  • Singleton Pattern: All request models use intuitive GameballApp.getInstance() with compile-time validation
  • Null Safety: Leverages TypeScript's null safety features to prevent runtime crashes
  • Promise-based API: Modern async architecture using async/await with optional callback support

πŸ› οΈ Enhanced Developer Experience

  • Unified API Design: Consistent method signatures and naming conventions
  • Better Error Handling: Comprehensive error types with proper callback mechanisms
  • IDE Support: Improved auto-completion and IntelliSense support
  • Type Safety: Compile-time validation prevents common integration errors

πŸ“Š Improved Functionality

  • Enhanced Customer Management: New InitializeCustomerRequest with comprehensive configuration options
  • Advanced Event Tracking: Restructured Event system with flexible metadata support
  • Profile Widget Enhancements: ShowProfileRequest for detailed widget customization
  • Push Notification Support: Integrated Firebase and Huawei push provider handling

πŸš€ Key Features

Centralized Configuration

const gameballConfig = {
  apiKey: 'your-api-key',
  lang: 'en', // 'en' or 'ar'
  shop: 'your-shop-id', // optional
  platform: 'your-platform-id' // optional
};

await GameballApp.getInstance().init(gameballConfig);

Customer Initialization with TypeScript Interfaces

const customerRequest = {
  customerId: 'unique-customer-id',
  email: 'customer@example.com',
  customerAttributes: {
    displayName: 'John Doe',
    customAttributes: {
      'tier': 'gold',
      'source': 'mobile_app'
    }
  },
  deviceToken: 'firebase-token',
  pushProvider: PushProvider.Firebase
};

const response = await GameballApp.getInstance().initializeCustomer(customerRequest);

Enhanced Event Tracking

const event = {
  customerId: 'unique-customer-id',
  events: {
    'purchase_completed': {
      'amount': 99.99,
      'currency': 'USD',
      'item_count': 3
    }
  }
};

await GameballApp.getInstance().sendEvent(event);

Flexible Customer Attributes

const customerAttributes = {
  displayName: 'John Doe',
  firstName: 'John',
  lastName: 'Doe',
  customAttributes: {
    'membership_tier': 'gold',
    'favorite_category': 'electronics'
  },
  additionalAttributes: {
    'utm_source': 'mobile_app',
    'campaign_id': 'summer2023'
  }
};

⚠️ Breaking Changes

This is a major release with breaking changes. Migration is required for existing v2.x users.

API Changes

  • registerCustomer() β†’ initializeCustomer() with TypeScript interfaces
  • Method signatures updated to use interface-based requests
  • Service method renamed from individual calls to GameballApp.getInstance()

Model Changes

  • Legacy request models β†’ TypeScript interfaces with comprehensive validation
  • Enhanced CustomerAttributes with structured customAttributes and additionalAttributes
  • New Event model with nested events object structure
  • New ShowProfileRequest for profile widget customization

Removed Features

  • Legacy builder pattern functionality (replaced with TypeScript interfaces)
  • Multiple method overloads (replaced with single interface-based methods)
  • String-based push providers (replaced with PushProvider enum)

πŸ“ˆ Performance Improvements

Optimized Architecture

  • Reduced Memory Usage: Eliminated duplicate object creation and unnecessary state management
  • Faster Initialization: Streamlined SDK initialization process with singleton pattern
  • Better Network Efficiency: Optimized request handling and error management
  • Improved Validation: Enhanced input validation prevents invalid API calls

Code Quality

  • 165 files changed: 3,247 additions, 1,892 deletions (net +1,355 lines)
  • Eliminated Data Duplication: Fixed issues where request data was copied multiple times
  • Better Error Handling: Proper callback-based error reporting instead of silent failures
  • Type Safety: TypeScript's type system prevents common runtime errors

πŸ”§ Technical Details

Requirements

  • Minimum React Native: 0.70.0
  • Target React Native: Latest
  • TypeScript: 4.0+
  • Node.js: 18.0+

Dependencies Updated

  • react-native-webview: ^13.0.2 (required peer dependency)
  • @react-native-async-storage/async-storage: ^1.17.10 (optional)
  • Removed legacy dependencies

Internal Improvements

  • Unified request/response handling with TypeScript interfaces
  • Enhanced AsyncStorage management for better data persistence
  • Improved Promise-based usage for async operations
  • Better separation of concerns in singleton architecture

πŸ›‘οΈ Security & Reliability

Enhanced Validation

  • Comprehensive input validation with proper error messages
  • Better API key management and validation
  • Improved customer ID validation
  • Enhanced request data validation with TypeScript

Error Handling

  • Specific exception types for different error scenarios
  • Proper callback-based error reporting with detailed messages
  • Better error logging and debugging support
  • Fail-fast validation to catch issues early

Data Protection

  • Improved request data handling with type safety
  • Better memory management with singleton pattern
  • Enhanced null safety with TypeScript
  • Proper error message sanitization

πŸ“š Migration Support

Migration Resources

  • Migration Guide: Step-by-step migration instructions from v2.x
  • README: Complete usage documentation with TypeScript examples
  • Changelog: Detailed list of all changes across versions

Breaking Changes Summary

  1. Update SDK initialization to use GameballApp.getInstance().init()
  2. Replace registerCustomer with initializeCustomer + TypeScript interfaces
  3. Update customer attributes to use structured customerAttributes object
  4. Migrate event tracking to new Event interface structure
  5. Update profile widget to use ShowProfileRequest interface

Support


πŸ“¦ Installation

npm

npm install react-native-gameball@^3.0.2
npm install react-native-webview

yarn

yarn add react-native-gameball@^3.0.2
yarn add react-native-webview

πŸ† Benefits Summary

βœ… Modern Architecture: React Native-first design with TypeScript interfaces
βœ… Better Developer Experience: Comprehensive type safety with IDE support
βœ… Enhanced Performance: Optimized internal architecture with singleton pattern
βœ… Improved Reliability: Better error handling and validation with TypeScript
βœ… Type Safety: Compile-time validation prevents runtime errors
βœ… Future-Ready: Modern foundation for upcoming React Native features
βœ… Comprehensive Documentation: Complete guides and TypeScript examples


⭐ Acknowledgments

We thank our development community for their feedback and contributions that made this release possible. Special thanks to developers who tested the beta versions and provided valuable insights for improving the TypeScript integration and developer experience.


Ready to upgrade? Start with our Migration Guide.

For technical support during migration, contact support@gameball.co