Firebase দিয়ে Background SMS Automation

Campaign start থেকে FCM wake-up, WorkManager job claim এবং idempotent status report-এর পুরো flow।

BBartago Editorial TeamResponsible messaging field guide · Updated ২৮ জুলাই, ২০২৬
Firebase দিয়ে Background SMS Automation বিষয়ক Bartago editorial illustration

Push notification নিজে SMS পাঠানোর guarantee নয়; এটি device worker-কে জাগানোর signal। Campaign start হলে server selected device-এর FCM token-এ data message পাঠায়। Android service সেই signal থেকে unique WorkManager job চালায়, server থেকে assigned SMS claim করে, SIM দিয়ে পাঠায় এবং ফল report করে। Network বা process interruption হলেও claim ও reporting আলাদা রাখলে duplicate send-এর risk কমে। Force-stop এবং aggressive battery optimization-এর মতো Android limitation অবশ্যই operation plan-এ ধরতে হবে।

01

Wake-up এবং source of truth

FCM trigger, server authority

Push payload হারাতে বা delay হতে পারে, তাই campaign state server database-এ থাকে। worker wake হলে authenticated API দিয়ে নিজের assigned pending job claim করে।

02

Pull ও direct dispatch

Batch resilience বনাম low latency

Pull mode device-কে campaign-ready signal দিয়ে bounded batch claim করায়। direct mode নির্দিষ্ট log identity ও rendered body বহন করতে পারে, তবু send-এর আগে exact job reserve করে।

03

Result retry আলাদা রাখুন

Report retry মানে resend নয়

Radio send successful কিন্তু network offline হলে status reporting worker পরে API call retry করে। SMS পুনরায় পাঠানো উচিত নয়। idempotent callback একই result নিরাপদে গ্রহণ করে।

  • Unique work name
  • Atomic claim
  • Stale-claim recovery
  • Exponential backoff
  • Idempotent report

ব্যবহারিক checklist

  • Valid FCM token
  • Background permission
  • Unique job
  • Claim before send
  • Separate reporting retry
মূল takeaway

Reliable automation-এর মূল নীতি: push শুধু wake করে; server assignment ও claim duplicate প্রতিরোধ করে।

শেষ কথা

Background test বাস্তব device-এ screen off, app swiped away এবং temporary network loss—তিন অবস্থায় চালান। force-stopped app নিজে recover নাও করতে পারে, তাই device health alert ও operator SOP রাখুন। Time-critical traffic-এর জন্য fallback channel পরিকল্পনা করুন।

নিজের SIM, আপনার নিয়ন্ত্রণ—সঙ্গে দায়িত্বও আপনার।

Campaign চালুর আগে consent, mobile operator policy এবং প্রযোজ্য current নিয়ম যাচাই করুন।

১০০ free automation credit দিয়ে শুরু করুন →

সাধারণ প্রশ্ন

Notification না দেখালেও কাজ হবে?

Data message background service trigger করতে পারে, তবে Android state ও policy অনুযায়ী behavior বদলায়; বাস্তব device test জরুরি।

Status API fail হলে SMS আবার যাবে?

Reporting retry send operation থেকে আলাদা হলে একই SMS পুনরায় পাঠানোর দরকার হয় না।

Sources ও editorial note

সর্বশেষ editorial review: ২৮ জুলাই, ২০২৬। Product behavior release অনুযায়ী বদলাতে পারে; current documentation দেখুন।